Pixel value of image in Access form imagebox, GDI32 (1 Viewer)

Wolow

Registered User.
Local time
Today, 08:04
Joined
Dec 27, 2009
Messages
10
Hi,
I try to read out pixel values (rgb) from a pciture box in an access form. I have found that there is a picture box in plain vb, but this seems not to translate to the picture in an access form.
I did try with
Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
Declare Function GetWindowDC Lib "user32" (ByVal hWnd As Long) As Long
Declare Function GetPixel Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long) As Long

h = GetWindowDC(Forms!img.hWnd)
or
h = GetDC(Forms!img.hWnd).
With API GDI32 set/getpixel i get something close to that what i need, although just slow
pixelColour = GetPixel(h, x, y)
Problem: the first just delivers everything including the window frame, and I do not know what the dimensions of the frame are.
The second just gives me access to e.g. the record marker, but not to the content of the form. If I use setpixel, just the area of the record marker is coloured.
So I am stuck.
Thanks a lot for any help.
 

Users who are viewing this thread

Top Bottom