Click here to Skip to main content
15,892,643 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Find the brightest and darkest pixel coordinates in an image using C++?
Posted
Comments
Legor 17-Sep-14 9:31am    
Using which API? Be more specific.

1 solution

For compressed images; draw the image on a (memory) DC and GetPixel API to get the values and compare them.

For uncompressed images: You can also access the image in the memory and fetch its data, but it depends on the internal data format.
 
Share this answer
 
Comments
barneyman 17-Sep-14 23:07pm    
if the OP wants actual brightness, they'll have to convert that RGB to HSL, specifically L - http://www.rapidtables.com/convert/color/rgb-to-hsl.htm
KarstenK 18-Sep-14 3:50am    
the Question is so unspecified that it isnt possible to give a better answer. :-(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900