Finding an image's resolution? (c++)

Started by
2 comments, last by Ekim_Gram 19 years, 11 months ago
I''m just curious. Is there any possible way to finding the resolution of a bitmap image? Why? I dunno...just for the hell of it. Maybe it would help with some bitmap handling functions...I honestly forgot the reason why but I was thinking about it a few hours ago while eating my dinner. VG-Force | Ekim Gram Productions
Advertisement
The header for the bitmap format is fairly well documented. Basically the second and third entry in the BITMAPINFOHEADER structure are the width and height respectively. If you were doing this in C++, you would open the file, read in a BITMAPFILEHEADER, do whatever validation you feel like on that (make sure it''s a bitmap etc.) then read in the BITMAPINFOHEADER.
Yep,

and if it''s a HBITMAP you have in memory already use GetObject with a BITMAP struct.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

try wotsit.com

This topic is closed to new replies.

Advertisement