S
schlefty
Here is what I am trying to do. I need to grab the color from a pixel
that I have loaded to an Image on the form.
I am using this function to grab the pixel:
Private Declare Function GetPixel Lib "GDI32" (ByVal hDC As Long, ByVal
X As Long, ByVal Y As Long) As Long
Which means that I need the hDC of the image. In order to do that I am
using this function:
Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As
Long
Which means that I need the hWnd of the image, but I can't find it
anywhere. I've tried using this function to grab it:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
But this function requires the caption of the Image, but Images in VBA
don't use captions. Is there any other way for me to find the hWnd of
the image? I can't simply use the hWnd of the form because my GetPixel
function won't grab the pixel from the image, only from the form
itself. I'm at a loss. Any help would be great.
Thanks
that I have loaded to an Image on the form.
I am using this function to grab the pixel:
Private Declare Function GetPixel Lib "GDI32" (ByVal hDC As Long, ByVal
X As Long, ByVal Y As Long) As Long
Which means that I need the hDC of the image. In order to do that I am
using this function:
Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As
Long
Which means that I need the hWnd of the image, but I can't find it
anywhere. I've tried using this function to grab it:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
But this function requires the caption of the Image, but Images in VBA
don't use captions. Is there any other way for me to find the hWnd of
the image? I can't simply use the hWnd of the form because my GetPixel
function won't grab the pixel from the image, only from the form
itself. I'm at a loss. Any help would be great.
Thanks