 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Question_dev
Joined: 24 Aug 2007 Posts: 88
|
Posted: Sun Mar 30, 2008 2:19 am Post subject: Get image size |
|
|
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: | 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: | 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 |
|
| Back to top |
|
 |
hibbyware
Joined: 28 Mar 2007 Posts: 78
|
Posted: Sun Mar 30, 2008 3:13 am Post subject: |
|
|
You should take a look inside graphics.h you may learn something, lol
| Code: |
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);
|
|
|
| Back to top |
|
 |
ne0h
Joined: 21 Feb 2008 Posts: 386
|
Posted: Sun Mar 30, 2008 3:23 am Post subject: |
|
|
| See Easy_Accelerated_Image_lib_0.2, is better! |
|
| Back to top |
|
 |
Question_dev
Joined: 24 Aug 2007 Posts: 88
|
Posted: Mon Mar 31, 2008 9:28 am Post subject: |
|
|
| hibbyware wrote: | You should take a look inside graphics.h you may learn something, lol
| Code: |
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 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|