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 Discussion / screenshot help

Author
Message
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 26th Dec 2007 18:45
hey guys!

I have two questions:

1.) How do I take a screenshot of darkbasic in the editor or in the game? is there som button like f5 or f6 i can just push?

2.) How do i save whatever is displayed on the screen to a bitmap?

Many thanks!

Oooooops!!! I accidentally formated drive c.
Jmahmood
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: not sure
Posted: 26th Dec 2007 18:56
Ans to your question 1:-

Press F9.

Ans to your question 2:-

Here is a command you can use,



TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 26th Dec 2007 19:47
Thanks mate! I was troubled with those buttons in 1.)
With 2.) I didnt know how to store the picture shown in internal memory. The rest is clear.

Thanks a lot!!

Oooooops!!! I accidentally formated drive c.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 26th Dec 2007 22:26
Bitmap 0 is the screen.
Save Bitmap 0

Jmahmood
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: not sure
Posted: 27th Dec 2007 04:46
Quote: "Bitmap 0 is the screen."


i didnt knew that!!

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 27th Dec 2007 21:41 Edited at: 27th Dec 2007 21:43
To the post above: I didnt KNOW that.

Quote: "Bitmap 0 is the screen.
Save Bitmap 0"


You need a name for the bitmap 0:



But it`s much easier to leave the 0 away:

:

I don`t want to look like a smart-ass...

Oooooops!!! I accidentally formated drive c.
Jmahmood
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: not sure
Posted: 28th Dec 2007 07:04
If you wish to take more then one screenshot you will need to use a different code or the file will be over written.

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 28th Dec 2007 09:35
Your right! So how about this:



Now No file will be overwritten.

Oooooops!!! I accidentally formated drive c.
Jmahmood
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: not sure
Posted: 28th Dec 2007 13:10
Quote: "Your right!"


You're right!


The code looks fine.

Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 28th Dec 2007 15:09
I think leaving out the 0 is just likely to be confusing.

The way you have the filename now all files will have "00" before the number even numbers greater than 9 e.g. "00199", I've added in a little code to make all number three digital.


jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 28th Dec 2007 15:44
I like that one... though I don't see a perfect LEFT ZERO PADDED fucntion call here yet.

RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 28th Dec 2007 15:54
You can press the Print Screen button (usually says Prnt Scrn on the key), that will take a snapshot of the screen and place it on the clipboard, allowing you to open up paint and paste it in.

Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 28th Dec 2007 16:05
Quote: "You can press the Print Screen button (usually says Prnt Scrn on the key), that will take a snapshot of the screen and place it on the clipboard, allowing you to open up paint and paste it in."

Where's the fun in that

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 28th Dec 2007 17:38
LoL ... though he brings up a good point, what would it take to make a game companion program - scan user32.dll for printscreen button, poll the clipboard, and save stuff for ANY GAME. (They have tools like that but... I digress

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 29th Dec 2007 01:46
Actually, it doesn't take that much. You need user32, gdi32, and a memblock. You can use the DB keystate() command or scancode() to check for the keypress of PrintScreen. Once it's found call the function that opens the clipboard, get the information of CF_BITMAP or type 2, transfer the bits into the memblock, close the clipboard, make an image or a bitmap from the memblock and save it or display it. If you want a forced keypress as a result of some other action in your program, use the keybd_event from user32 to force the PrintScreen key to be pressed.

Enjoy your day.
Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 31st Dec 2007 17:19 Edited at: 31st Dec 2007 17:19
you can force keys to be pressed!!!!!!!!!!!!


Maryville Game Developers
Visit our website at http://www.freewebs.com/maryville-game-developers/index.htm
demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 8th Jan 2008 13:13
@Pixelator: I think it just has the effect of the key being pressed. Not actually forcing the key to be pressed. Although that would be really cool if you were sitting looking at your keyboard and it was just typing merrily away.

"A West Texas girl, just like me"
-Bush
Sinani201
18
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 9th Jan 2008 05:52
Quote: "you can force keys to be pressed!!!!!!!!!!!!"

You can do it with mouseclicks, too. I made a simple macro for a game that is slightly boring. But now I have a new monitor so it doesn't work

Seriously, how do you make the little blue text come up below your message?
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th Jan 2008 17:21
Quote: "you can force keys to be pressed!!!!!!!!!!!!"

yes

Login to post a reply

Server time is: 2025-06-02 09:49:11
Your offset time is: 2025-06-02 09:49:11