forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Get color from image or at X and Y

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Fri Jun 20, 2014 11:24 pm    Post subject: Get color from image or at X and Y Reply with quote

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
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sat Jun 21, 2014 6:10 am    Post subject: Reply with quote

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
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sat Jun 21, 2014 6:35 am    Post subject: Reply with quote

Disregard. I found a forum post with the api call already converted. Smile

~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
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Sun Jun 22, 2014 3:07 pm    Post subject: Reply with quote

Well, vdscap.dll also gets the color of a pixel, just FYI.
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sun Jun 22, 2014 6:18 pm    Post subject: Reply with quote

vdscap, part of VDSDLL... read my first post in this thread. Wink

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. Smile

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Sun Jun 22, 2014 6:22 pm    Post subject: Reply with quote

ah yes, so it is.

That is very cool. Care to share the api for the color selection? Smile

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sun Jun 22, 2014 6:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sun Jun 22, 2014 6:27 pm    Post subject: Reply with quote

Here's the thread:

http://www.vdsworld.com/forum/viewtopic.php?t=1847&highlight=getpixel

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Sun Jun 22, 2014 6:29 pm    Post subject: Reply with quote

cool thanks
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sun Jun 22, 2014 6:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group