Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Captureing Screen into Image

Author
Message
SirReal
23
Years of Service
User Offline
Joined: 20th May 2003
Location:
Posted: 20th Jun 2003 10:39
Ok,

I'm a touch confused.

I am trying to capture the current screen and stuff it into an image.



BUT, it does not seem to work... the image gets created, but it has nothing in it.

What am I doing wrong?

SirReal
SirReal
23
Years of Service
User Offline
Joined: 20th May 2003
Location:
Posted: 20th Jun 2003 10:41
Just in case it makes a difference, my current screen is composed of a number of sprites on top of a pasted image.

SirReal

Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 20th Jun 2003 11:15
if eventuly you want to captuere a sequence of screens. i would suggest using a program called camtasia. its freeware and does a dam god job just incase this one screen capturing thing was gonna be developed to creating animations [img] [/img]

YOU WANT A NICE AVATAR YEAH! YOU WANT A NICE AVATAR ILL GIVE YOU A *** *** NICE AVATAR THATS SO POLITE AND BLUNT YOU CANT POSSIBLEY COMPLAIN CUS IT HAS NO BAD LANGUAGE AND IS IN NO WAY OFFENSIVE SO HA
ICERGB
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 20th Jun 2003 14:03
I assure you there has been alot of posts to this same question...
Maybe if you give more code, as you have it now the there is nothing on the screen to copy.
And the code you offer does nothing with the image.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th Jun 2003 15:08
You also have to take into account that what you see on screen is *not* what is on your bitmap.

When the display is synced, a snapshot is taken of the background where each sprite is positioned, then the sprite is drawn, then the display is shown, and finally, the saved background areas are restored.

There are ways around this, but we'd need to see some code to advise on the best way for you
SirReal
23
Years of Service
User Offline
Joined: 20th May 2003
Location:
Posted: 20th Jun 2003 19:14
Attached is an example.

It gives the essance of what I'm trying to do. Capture the screen ( as displayed to the Player/user ) and place it on a sprite for manipulation.

Once the program is running, hit space and it will create the image and sprite that I want to be a screen image.

The sprite is comming out blank. If you notice , the blue square will be overlapped by the blank screen image.

SirReal
23
Years of Service
User Offline
Joined: 20th May 2003
Location:
Posted: 20th Jun 2003 19:15
Whoops, use the source on this one, NOT the one above. Forgot to change the background color on this one to prevent the screen sprite from being transparant.

SirReal
23
Years of Service
User Offline
Joined: 20th May 2003
Location:
Posted: 21st Jun 2003 19:22
So, anyone have a solution?

How do people write internal screenshot routines If this doesnt work?

SirReal

MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 22nd Jun 2003 03:05
You would need access to DX - currently you cant get snapshots of sprites...
Therefore another program like Hypersnap should be used...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Jun 2003 03:58
A possible way would be to create a duplicate bitmap, copy the screen image to it, and then paste all the sprites to it. It would be damned slow, but then again, you won't be running it frame-by-frame.
Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 22nd Jun 2003 13:28 Edited at: 22nd Jun 2003 13:29
IanM: my thoughts exactly, it would not be that slow if you are saving screens continously to ram, and if you plan some kind of animation tool then the save to disk will take far longer than the screen update, should be managable, you could try stuffing the bitmaps into a huge memblock (that would effectivley make your memory a ramdisk), that should hold quite a few frames of animation, cheers.

Mentor.

Login to post a reply

Server time is: 2026-07-17 19:34:13
Your offset time is: 2026-07-17 19:34:13