Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Real World

Finding Image dimensions of a png

This topic is 5614 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Anyone know how to find the width and height of a png file loaded into a program at run time. Im using DX8.1 and C++ if that helps I know this works for a Bitmap...
BITMAP Bitmap;
			HBITMAP hBitmap;
		// Load the bitmap first using the GDI to get info about it
		hBitmap = (HBITMAP)LoadImage( NULL, filenameOn, IMAGE_BITMAP, 0, 0, 
		if( hBitmap == NULL )
			// The file probably does not exist
			LogError( "Unable to load bitmap" );
			return E_FAIL;

		// Get information about the object
		GetObject( hBitmap, sizeof( BITMAP ), &Bitmap );
		// Unload the bitmap from memory
		DeleteObject( hBitmap ); 
But is there something similar [or easier] for a png file Cheers Planetblaze.com - http://www.planetblaze.com - As METAL as it gets!

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!