View previous topic :: View next topic |
Author |
Message |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Fri Jun 20, 2014 11:24 pm Post subject: Get color from image or at X and Y |
|
|
Ok, I'm using the VDSDLL right now, but for my purposes it's failing and I'd like to know if there's an API or any other way to get the color of a pixel at a specific location.
What I'm doing is taking in an image, loading it on my dialog and then using the VDSDLL to capture the color for each pixel in the image and then adding that color code to a list.
The problem is, the VDSDLL no longer returns the right colors after a few shots in a row. I don't think the dll considered someone repeatedly hitting it for this information a few thousand times in a row.
If there's any API, that would probably be more suited.. Any info appreciated and thanks in advance,
~Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Sat Jun 21, 2014 6:10 am Post subject: |
|
|
Can anyone convert this to VDS?
Gdi32.dll
Code: | COLORREF GetPixel(
_In_ HDC hdc,
_In_ int nXPos,
_In_ int nYPos
); |
Code: | http://msdn.microsoft.com/en-us/library/dd144909(VS.85).aspx |
Any help is greatly appreciated, thanks,
~Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Sat Jun 21, 2014 6:35 am Post subject: |
|
|
Disregard. I found a forum post with the api call already converted.
~Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Sun Jun 22, 2014 3:07 pm Post subject: |
|
|
Well, vdscap.dll also gets the color of a pixel, just FYI. _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Sun Jun 22, 2014 6:18 pm Post subject: |
|
|
vdscap, part of VDSDLL... read my first post in this thread.
Besides, the api calls are quicker when called directly instead of via a dll.
What I was trying to do finally worked using the api calls, but yet, was a complete failure. I was converting images to html tables. worked great for like little 16x16 images, but the bigger they got, the longer it took a web browser to load.
I did this with one image that created a table with near 900,000 table cells.. LOL... Looked wonderful actually, just like the actual image, but it took like 5 minutes for google chrome to load the page.. LOL
in the end, it was a fun project that was successful and a failure. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Sun Jun 22, 2014 6:22 pm Post subject: |
|
|
ah yes, so it is.
That is very cool. Care to share the api for the color selection? _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Sun Jun 22, 2014 6:25 pm Post subject: |
|
|
Oh great, now that I've deleted the file and forgot which post on the forums I found it! LOL.. No, I can find it again, hold on, BRB _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Sun Jun 22, 2014 6:30 pm Post subject: |
|
|
BTW, the speed difference between using the dll and the api was extreme. Using the DLL for say a 16x16 image, if it didn't choke, took a few minutes while using the API it took less than a second. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
|