 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
gambiting
Joined: 17 Aug 2006 Posts: 154
|
Posted: Sat Aug 18, 2007 5:44 am Post subject: How to take a screenshot?Please help |
|
|
| Hi! Could anyone help me on how to make a screenshot inside my own app?I know I can do this using psplink or other software,but I would like to have this functionality built in.Please tell me what code and libriary should I use to be able to make a screenshot and save it as bmp or png.Thanks! |
|
| Back to top |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Sat Aug 18, 2007 3:53 pm Post subject: |
|
|
Hi,
Obviously you need to include the png and graphics libs.
then this function that came from some sample, or somewhere else
here on ps2dev.org:
| Code: |
void saveScreen() {
int posX;
int posY;
Color pixel;
Color* vram = getVramDisplayBuffer();
Image* screenShot;
screenShot = createImage(480,272);
for (posY=0; posY<272; posY++) {
for(posX=0; posX<480; posX++) {
pixel = vram[PSP_LINE_SIZE * posY + posX];
putPixelImage(pixel,posX,posY,screenShot);
}
}
saveImage("ms0:/Snapshot.png",screenShot->data,480,272,PSP_LINE_SIZE,0);
freeImage(screenShot);
}
|
Cheers, Art. |
|
| Back to top |
|
 |
gambiting
Joined: 17 Aug 2006 Posts: 154
|
Posted: Sat Aug 18, 2007 5:06 pm Post subject: |
|
|
| Thanks,it works,you helped me a lot :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
|