Skip to: Site menu | Main content


Welcome to PSP-Programming.com, a place for developers to get together.

Welcome to the forums. Here you can find other user tutorials as well as homebrew releases and the source code repository. You can also ask for help with your code here and post your own homebrew!

PSP-Programming.com Forums
March 21, 2010, 11:25:34 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

News: Join our IRC channel: ##psp-programming on freenode
Home Help Search Shop Login Register
Digg This!
Pages: [1]
Print
Author Topic: Screenshot Example UP in the CODE Repository  (Read 3659 times)
SG57
Sr. Member
****

Karma: +7/-37
Offline Offline

Posts: 474
1140.80 points

View Inventory
Send Money to SG57


View Profile
« on: May 29, 2006, 05:30:35 PM »

http://www.psp-programming.com/code/index.php?id=c:screenshot

Just made it...  Take a look...
Logged


Insert_Witty_Name
Global Moderator
Hero Member
*

Karma: +148/-17
Offline Offline

Posts: 1602
1141.66 points

View Inventory
Send Money to Insert_Witty_Name

View Profile WWW
« Reply #1 on: May 29, 2006, 06:13:03 PM »

Looks good.

Your link to the header file is messed up though, I see _ instead of / in the path.

Also think you should at least credit Shine for this as well.
Logged

Coder formerly known as:

Check out my homebrew & C tutorials at http://insomniac.0x89.org
Last updated 6th Oct 06 - Tutorial 2 added.
SG57
Sr. Member
****

Karma: +7/-37
Offline Offline

Posts: 474
1140.80 points

View Inventory
Send Money to SG57


View Profile
« Reply #2 on: May 29, 2006, 07:07:43 PM »

Shine?  I gave credit to the real devleoper in the header and in the example...

it was Jason who made it...

Ill get right on that link, and i think its Yeldarbs fault because he said he was moving the header to a more permanent spot...
Logged
Insert_Witty_Name
Global Moderator
Hero Member
*

Karma: +148/-17
Offline Offline

Posts: 1602
1141.66 points

View Inventory
Send Money to Insert_Witty_Name

View Profile WWW
« Reply #3 on: May 29, 2006, 09:44:02 PM »

http://forums.ps2dev.org/viewtopic.php?t=3112

12th post down - by Shine.

Jason's was a BMP/TGA version which didn't work.

The version you have is Shine's work, but edited by Jason (a few post below that link I gave).
Logged

Coder formerly known as:

Check out my homebrew & C tutorials at http://insomniac.0x89.org
Last updated 6th Oct 06 - Tutorial 2 added.
SG57
Sr. Member
****

Karma: +7/-37
Offline Offline

Posts: 474
1140.80 points

View Inventory
Send Money to SG57


View Profile
« Reply #4 on: May 29, 2006, 10:16:31 PM »

Well i guess Jason is a little sly pooch...  ill edit it really quick...
Logged
harleyg
Give miinaturvat Points!
Hero Member
*****

Karma: +11/-14
Offline Offline

Posts: 715
462.95 points

View Inventory
Send Money to harleyg


View Profile
« Reply #5 on: May 29, 2006, 11:32:49 PM »

Quote
* You MUST have the Portable Networks Graphic Library (PNGLib) installed to complie this *  Created By: SG57


good work.
Logged
Insert_Witty_Name
Global Moderator
Hero Member
*

Karma: +148/-17
Offline Offline

Posts: 1602
1141.66 points

View Inventory
Send Money to Insert_Witty_Name

View Profile WWW
« Reply #6 on: May 30, 2006, 03:21:00 AM »

Also, no offence, but this function is already implemented in libpng.

This line alone will take a screenshot:

Code:
saveImage("Screenshot.png", getVramDisplayBuffer(), SCREEN_WIDTH, SCREEN_HEIGHT, PSP_LINE_SIZE, 0);


I use the following code in AniMate to take screenshots when select is pressed.

[EDIT] Damn letter count limit in posts....
Link to Code: http://www.psp-programming.com/animate/screenshotcode.htm

Also you need to initialise the ScreenShotNumber variable somewhere at the start of your program with:

Code:
int ScreenShotNumber = 0;


The above code will auto-increment the screenshot number -- and unlike some other code snippets, will not overwrite any existing files (for example from a previous day of playing the game).

This code follows the KISS principal  Wink
Logged

Coder formerly known as:

Check out my homebrew & C tutorials at http://insomniac.0x89.org
Last updated 6th Oct 06 - Tutorial 2 added.
SG57
Sr. Member
****

Karma: +7/-37
Offline Offline

Posts: 474
1140.80 points

View Inventory
Send Money to SG57


View Profile
« Reply #7 on: May 30, 2006, 06:53:15 AM »

?  I did that completely...  And i know that's in the PNG Lib already, but it requires alot of parameters that is kinda of pointless if your capturing the entire screen, so why should you have to input how large the screen, is, just have the ACTUAL_WIDTH defined already without the need for it... Plus it requires the getVramDisplayBuffer() which is a pain to write each time when doing it.
Logged
Insert_Witty_Name
Global Moderator
Hero Member
*

Karma: +148/-17
Offline Offline

Posts: 1602
1141.66 points

View Inventory
Send Money to Insert_Witty_Name

View Profile WWW
« Reply #8 on: May 30, 2006, 09:52:20 AM »

Eh?

It's one line versus a whole function. All you need to to is the SCREEN_WIDTH and SCREEN_HEIGHT.

getVramDisplayBuffer() is no problem at all... you don't have to do anything... ?

I Don't see your point, sorry Shocked
Logged

Coder formerly known as:

Check out my homebrew & C tutorials at http://insomniac.0x89.org
Last updated 6th Oct 06 - Tutorial 2 added.
SG57
Sr. Member
****

Karma: +7/-37
Offline Offline

Posts: 474
1140.80 points

View Inventory
Send Money to SG57


View Profile
« Reply #9 on: May 30, 2006, 03:13:27 PM »

1. SCREEN_WIDTH
2. SCREEN_HEIGHT
3. getVramDisplayBuffer()
4. string as filename

Thats 4 things versus 1:

1. String as filename

Plus getVramDisplayBuffer() is just a hassle to remember as a parameter name...

Plus this is more of an example of how LUA specific functions can be converted...
Logged
Insert_Witty_Name
Global Moderator
Hero Member
*

Karma: +148/-17
Offline Offline

Posts: 1602
1141.66 points

View Inventory
Send Money to Insert_Witty_Name

View Profile WWW
« Reply #10 on: May 30, 2006, 04:37:09 PM »

You're forgetting the fact that the code you're calling is wrapped up in a function with 50 lines of code or whatever....

It'd take all of two seconds to wrap my line up in a function that only accepts one parameter (like yours does) and it'd be less than 5 lines...

Don't get me wrong, I'm not being hostile, I just can't see the point of making a function that is IDENTICAL to a function you already have access to!  Mr. Green
Logged

Coder formerly known as:

Check out my homebrew & C tutorials at http://insomniac.0x89.org
Last updated 6th Oct 06 - Tutorial 2 added.
Pages: [1]
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.148 seconds with 36 queries.
Sister Sites: Guitar Hero 4   BrokeniTouch.com