How can I figure out the size of an image file without loading the image?
I'm writing a little thumbnail control and my problem is that it's super slow because it uses loadpicture(). I can use the LoadImage() API, but the other problem is that I have to know the original size of the image before I can use LoadImage().
Is there any way to figure out the height and width of an image file without actually loading the whole thing? any API function to do that? or is it stored anywhere in the image file? ( I dont want to load the image compeletly because it will be the same speed as LoadPicture, my point is to figure out the size of the actuall image and do my calculations; then I would only load the image in a small size with LoadImage)
A Much Much simpler way...
Put a picbox on the form and make it "autosize" AND set the mode to "Pixels", then load the picture into the form :) Then take the width and height of the picbox, this will work with bitblt and/or directX. Its the simplest method I know. Hope its helpful.