The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Slugsnack on May 06, 2009, 06:09:17 PM

Title: GetPixel Failing?
Post by: Slugsnack on May 06, 2009, 06:09:17 PM
Any idea why it keeps returning CLR_INVALID?!

(http://i121.photobucket.com/albums/o222/Slugsnack/GetPixel.jpg)


[attachment deleted by admin]
Title: Re: GetPixel Failing?
Post by: Relvinian on May 06, 2009, 07:21:56 PM
Two things come to to the top of my mind:

1)  you are using GetPixel with the EBX.  But EBX is NULL....That parameter in GetPixel API should be the HDC handle.
2) GetPixel will only return the pixel if it is the current clipping region.

My guess is #1. ;-)

Relvinian
Title: Re: GetPixel Failing?
Post by: Slugsnack on May 06, 2009, 09:30:40 PM
Oh yeah !  Sorry that was when I was trying out other crap to try to make it work..  I changed it to null.  Before then I had it as hDC from the GetDC call but it didn't work then either.
Title: Re: GetPixel Failing?
Post by: Slugsnack on May 07, 2009, 11:08:52 AM
Oh no !  I am stupid.. kill me.  I had messed up and forgotten to change that parameter to hDC and that was what was wrong LOL.  It works perfectly now.  Thanks !!
Title: Re: GetPixel Failing?
Post by: Farabi on May 08, 2009, 12:26:33 PM
SlugSnack:
If you have understand all necessary things about it, try using donkey graph lib. It will speed up things. But I dont know about GDIp new setpixel function speed.
Title: Re: GetPixel Failing?
Post by: Slugsnack on May 08, 2009, 10:19:48 PM
I was just using it to beat my brother at this clicking game on asciitable.com XD

(http://img5.imageshack.us/img5/3552/clickb.jpg)