forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Get image size

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Question_dev



Joined: 24 Aug 2007
Posts: 88

PostPosted: Sun Mar 30, 2008 2:19 am    Post subject: Get image size Reply with quote

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
View user's profile Send private message
hibbyware



Joined: 28 Mar 2007
Posts: 78

PostPosted: Sun Mar 30, 2008 3:13 am    Post subject: Reply with quote

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
View user's profile Send private message
ne0h



Joined: 21 Feb 2008
Posts: 386

PostPosted: Sun Mar 30, 2008 3:23 am    Post subject: Reply with quote

See Easy_Accelerated_Image_lib_0.2, is better!
Back to top
View user's profile Send private message
Question_dev



Joined: 24 Aug 2007
Posts: 88

PostPosted: Mon Mar 31, 2008 9:28 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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