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 

Image Viewer

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



Joined: 14 Aug 2005
Posts: 2

PostPosted: Sun Aug 14, 2005 2:08 am    Post subject: Image Viewer Reply with quote

Hi!

I will like to write a simple program: a image viewer.

The problem i have right now is that i do not know how i have to treat the images under C (i will like it to work, first, over JPG images) . I will like the program to read the images from a directory in the MS and show them, but i donīt know how to show a image ... can anyone help me? do you know of any existing code to do this?

Thanks!
Back to top
View user's profile Send private message MSN Messenger
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Sun Aug 14, 2005 2:36 am    Post subject: Reply with quote

You can use the loadImage function from graphics.c, but currently it supports png, only. With the other functions from graphics.c it would look like this (not tested, but should work) :

Code:

initGraphics();
Image* image = loadImage("yourimage.png");
blitImageToScreen(0, 0, image->imageWidth, image->imageHeight, image, 0, 0);
flipScreen();


If you have changed the loadImage-function to load JPGs, let me know, then I can add it to my function, too.

Another idea is to use SDL. I'm sure there are some demo applications written in SDL, which are doing what you want, including perhaps image scaling and all kinds of graphics formats. Compiling SDL programs for PSP should be possible without much changes.
Back to top
View user's profile Send private message
garich



Joined: 14 Aug 2005
Posts: 2

PostPosted: Sun Aug 14, 2005 2:38 am    Post subject: Reply with quote

Sorry but .... what is SDL??

Thanks!
Back to top
View user's profile Send private message MSN Messenger
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Sun Aug 14, 2005 2:41 am    Post subject: Reply with quote

garich wrote:
Sorry but .... what is SDL??


Google, first result: http://www.libsdl.org/

It is in the PSP svn repository and is already used for some programs from the pspware PSP svn repository.
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