GetPixel API 
Author Message
 GetPixel API

Help me please!

Does anybody know how to use the GetPixel Api call to get the color of a
pixel, anywhere on the screen. Not just within a form or object?

Thanks in advance.



Fri, 30 May 2003 00:52:33 GMT  
 GetPixel API
Chris,

Quote:
>Does anybody know how to use the GetPixel Api call to get the color of a
>pixel, anywhere on the screen. Not just within a form or object?

Dim hdcScreen As Long

hdcScreen = GetDC(0)
color = GetPixel(hdcScreen, x, y)
Call ReleaseDC(hdcScreen)

Matt

============================================

  CodeHound - Free VB Search Engine
  http://www.codehound.com



Fri, 30 May 2003 01:50:20 GMT  
 GetPixel API

Thanks, thats just what I was looking for!


Quote:
> Chris,

> >Does anybody know how to use the GetPixel Api call to get the color of a
> >pixel, anywhere on the screen. Not just within a form or object?

> Dim hdcScreen As Long

> hdcScreen = GetDC(0)
> color = GetPixel(hdcScreen, x, y)
> Call ReleaseDC(hdcScreen)

> Matt

> ============================================

>   CodeHound - Free VB Search Engine
>   http://www.codehound.com



Fri, 30 May 2003 05:12:58 GMT  
 GetPixel API

Quote:
> Dim hdcScreen As Long

> hdcScreen = GetDC(0)
> color = GetPixel(hdcScreen, x, y)
> Call ReleaseDC(hdcScreen)

GetDC(0) sometimes has problems though.  If you get problems try something
like:

Dim DeskWnd As Long
Dim DeskDC As Long
Dim TargCol As Long

DeskWnd = GetDesktopWindow()
DeskDC = GetDC(DeskWnd)
TargCol = GetPixel(DeskDC, X, Y)
ReleaseDC(DeskWnd, DeskDC)

Hope this helps,

    Mike

 -- EDais --

WWW: Http://Members.xoom.com/EDais/




Fri, 30 May 2003 10:27:39 GMT  
 GetPixel API


Quote:
>GetDC(0) sometimes has problems though.  If you get problems try something
>like:

What problems have you encountered?

--
Richard Mason



Fri, 30 May 2003 16:53:45 GMT  
 GetPixel API

Quote:
> What problems have you encountered?

Personally I've never had any problems with it, but there's been a couple of
posts on here about it, I think under NT?  Not sure though.

    Mike

 -- EDais --

WWW: Http://Members.xoom.com/EDais/




Fri, 30 May 2003 23:58:11 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. GetPixel API

2. GetPixel API call

3. GetPixel API???

4. Help ! Problem with GetPixel API Call

5. GetPixel API in VB6?????

6. GetPixel API in VB6?????

7. What is wrong with GETPIXEL API call??

8. GetPixel API problem

9. GetPixel API in VB6?????

10. GetPixel API in VB6?????

11. GetPixel API to Get Pixel RGB on A VB Form Does not work why?

12. GetPixel API to Get Pixel RGB on A VB Form Does not work why?

 

 
Powered by phpBB® Forum Software