S
schlefty
Here is what I am trying to do. I need to be able to grab a pixel from
an image that I have on the form. In order to do that I am using this
function:
Private Declare Function GetPixel Lib "GDI32" (ByVal hDC As Long, ByVal
X As Long, ByVal Y As Long) As Long
But this requires the hDC of the Image. I tried to find that by using
this function:
Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As
Long
But this means that I need the hWnd of the image. I tried to grab that
by using this:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
But that only works if I use the caption, but Images don't have
captions. So is there any other way I can find either the specific hDC
or hWnd of the image? I can't simply use the hWnd of the form, because
then my GetPixel function will only grab pixels from the form itself
and not from the image. I'm at a loss. Any help would be great. Thanks.
an image that I have on the form. In order to do that I am using this
function:
Private Declare Function GetPixel Lib "GDI32" (ByVal hDC As Long, ByVal
X As Long, ByVal Y As Long) As Long
But this requires the hDC of the Image. I tried to find that by using
this function:
Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As
Long
But this means that I need the hWnd of the image. I tried to grab that
by using this:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
But that only works if I use the caption, but Images don't have
captions. So is there any other way I can find either the specific hDC
or hWnd of the image? I can't simply use the hWnd of the form, because
then my GetPixel function will only grab pixels from the form itself
and not from the image. I'm at a loss. Any help would be great. Thanks.