Results 1 to 2 of 2

Thread: maybe a stupid question...

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Posts
    27

    maybe a stupid question...

    how do i get the color of a certain point in a picture box that the user clicks on?

  2. #2
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724
    VB Code:
    1. Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
    2.  
    3. private sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    4.     dim lngcolour as long
    5.     lngcolour = getpixel(picture1.hdc, x/Screen.twipsperpixelx, y/screen.twipsperpixely
    6. end sub

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