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 

How to take a screenshot?Please help

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



Joined: 17 Aug 2006
Posts: 154

PostPosted: Sat Aug 18, 2007 5:44 am    Post subject: How to take a screenshot?Please help Reply with quote

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



Joined: 09 Nov 2005
Posts: 647

PostPosted: Sat Aug 18, 2007 3:53 pm    Post subject: Reply with quote

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



Joined: 17 Aug 2006
Posts: 154

PostPosted: Sat Aug 18, 2007 5:06 pm    Post subject: Reply with quote

Thanks,it works,you helped me a lot :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