Screen to Image

Advanced game related topics
User avatar
Demivec
Addict
Addict
Posts: 4260
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Screen to Image

Post by Demivec »

Parts of this topic have been dealt with but I need a more direct response than what I've found.

How do I grab a screen and copy it to an image. I know I can grab a screen and store it in a sprite. I do not know how to display the sprite on an image to complete the process. I imagine that a large sprite could be used to replace the use of the image as the destination, though it doesn't answer how to display a sprite on an image.

Would it have to be done via the screen capture methods with DirectX that have been posted elsewhere? I was hoping it wouldn't.



Speed is important, as usual.

As a side note, a new language feature that may be useful is duplicating the contents of the flipbuffers() for double buffering. This means to duplicate the displayed buffer contents in the hidden buffer.


Demivec
User avatar
travismcgee
New User
New User
Posts: 9
Joined: Mon May 29, 2006 2:16 am

Post by travismcgee »

May I ask why you want it in image form? What are you going to do with it that a sprite would not be suitable for?
josku_x
Addict
Addict
Posts: 997
Joined: Sat Sep 24, 2005 2:08 pm

Post by josku_x »

travismcgee wrote:May I ask why you want it in image form? What are you going to do with it that a sprite would not be suitable for?
Perhaps he is making a game and he wants to have a screenshot feature in his game which allows the user to take a screenshot of the game. I am not sure, but I think I saw an example in PureArea which did that.

Look in www.purearea.net in CodeArchiv.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Demivec,
perhaps you can get some interesting some stuff useful for you here:
http://www.purebasic.fr/english/viewtop ... 6779#96779

There, the macros called MyCopyBuffer and MyCopyBufferEx are useful to get displayed graphic info to an image or whatever buffer in memory.
What you need is to convert graphic data (add BMP , JPG, or whatever header) after copy the graph info.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
Demivec
Addict
Addict
Posts: 4260
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Post by Demivec »

travismcqee wrote:May I ask why you want it in image form? What are you going to do with it that a sprite would not be suitable for?
I wanted to do so because I had wanted to use the image as a type of buffer to test or change display types and then redisplay them as a whole composition. So in effect, with sprites moving over a background I would want to take a screen shot, then use this as a background (it could be retransferred to back into large sprites) for what would be displayed next with additional sprites over the top. I would also be able to test the parts of that new background image for effects based on conditions of what was present (in color form for instance).

psycopantha wrote:There, the macros called MyCopyBuffer and MyCopyBufferEx are useful to get displayed graphic info to an image or whatever buffer in memory.
What you need is to convert graphic data (add BMP , JPG, or whatever header) after copy the graph info.
This may fit the bill, though I think I still have questions about the conversion at the end you mentioned (how to accomplish it).


We are exploring other methods but the obvious ones seem to have roadblocks.


Demivec
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

Are you talking about just a basic screen capture?

Maybe some info in these posts also that might help you:

http://www.purebasic.fr/english/viewtop ... en+capture

http://www.purebasic.fr/english/viewtop ... en+capture

http://www.purebasic.fr/english/viewtop ... en+capture
Post Reply