 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
garich
Joined: 14 Aug 2005 Posts: 2
|
Posted: Sun Aug 14, 2005 2:08 am Post subject: Image Viewer |
|
|
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 |
|
 |
Shine
Joined: 03 Dec 2004 Posts: 728 Location: Germany
|
Posted: Sun Aug 14, 2005 2:36 am Post subject: |
|
|
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 |
|
 |
garich
Joined: 14 Aug 2005 Posts: 2
|
Posted: Sun Aug 14, 2005 2:38 am Post subject: |
|
|
Sorry but .... what is SDL??
Thanks! |
|
| Back to top |
|
 |
Shine
Joined: 03 Dec 2004 Posts: 728 Location: Germany
|
Posted: Sun Aug 14, 2005 2:41 am Post subject: |
|
|
| 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 |
|
 |
|
|
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
|