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

Real World

Finding Image dimensions of a png

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 - - As METAL as it gets!

Share this post

Link to post
Share on other sites