Results 1 to 4 of 4

Thread: Pixel level manipulation in vb6

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2005
    Posts
    21

    Pixel level manipulation in vb6

    I'm working on a simple project and it has been years since I set up vb to use the graphics library any help would be appreciated. I just want to plot some pixels in a picture box.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Pixel level manipulation in vb6

    Hi The Cubist, welcome to VBForums!

    You can do this using PSet, eg:
    VB Code:
    1. Picture1.PSet (10, 20), vbRed
    Note that you will probably want to set the ScaleMode of the PictureBox to Pixel.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 2005
    Posts
    21

    Re: Pixel level manipulation in vb6

    That will work just fine thanks alot

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Pixel level manipulation in vb6

    You can also use SetPixel, which is a bit more efficient.

    VB Code:
    1. Declare Function SetPixel(ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long
    2.  
    3. ' usage:
    4. SetPixel Picture1.hDC, 10, 20, vbRed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width