Get image size

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Question_dev
Posts: 88
Joined: Fri Aug 24, 2007 8:23 pm

Get image size

Post by Question_dev »

Hi

I have a filebrowser.

I can load png files, but how do i get the with and height of that image ?

This is what i have :

Code: Select all

		char buffer[200];
          	Image* Image; 

		sprintf(buffer, path);
          	Image = loadImage(buffer); 

		blitAlphaImageToScreen(0 ,0 ,480, 272, Image, 0, 0);

		flipScreen();
An image of 480x272 displays fine
But an image of 200x200 not...

So it need to be something (i dont now, just a thought) like this :

Code: Select all

		char buffer[200];
          	Image* Image; 

		sprintf(buffer, path);
          	Image = loadImage(buffer); 

		blitAlphaImageToScreen(0 ,0 ,with(Image), height(Image), Image, 0, 0);

		flipScreen();
But that doesn't work (Normal...)

Does someone now how to do this ?


Thanks in advance
hibbyware
Posts: 78
Joined: Wed Mar 28, 2007 10:29 am

Post by hibbyware »

You should take a look inside graphics.h you may learn something, lol

Code: Select all

	Image* myImage;

	myImage = loadImage("test.png");

	pspDebugScreenPrintf("Texture Width %d\n",myImage->textureWidth);
	pspDebugScreenPrintf("Texture Height %d\n",myImage->textureHeight);
	pspDebugScreenPrintf("Image Width %d\n",myImage->imageWidth);
	pspDebugScreenPrintf("Image Height %d\n",myImage->imageHeight);
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

See Easy_Accelerated_Image_lib_0.2, is better!
Question_dev
Posts: 88
Joined: Fri Aug 24, 2007 8:23 pm

Post by Question_dev »

hibbyware wrote:You should take a look inside graphics.h you may learn something, lol

Code: Select all

 Image* myImage;

 myImage = loadImage("test.png");

 pspDebugScreenPrintf("Texture Width %d\n",myImage->textureWidth);
 pspDebugScreenPrintf("Texture Height %d\n",myImage->textureHeight);
 pspDebugScreenPrintf("Image Width %d\n",myImage->imageWidth);
 pspDebugScreenPrintf("Image Height %d\n",myImage->imageHeight);
Very tnx! From now on, i will first take a look at the header files :D
Post Reply