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 / Rendering screenshot

Author
Message
Cyborg ART
19
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 20th Sep 2010 19:43
I have tried to find out an easy way to render a screenshot inside my game.
I have found some kind of succes when using get image, but it takes too long time.

So I am wondering if someone can tell me/give some pointers on how to write a basic code which renders the screen and then saves it as a jpg, bmp or whatever works best.


I have searched the forum using both the standard search and the google search with no luck.
Found someone talking about Fast sync and sync mask, but I have no idea on how to do it...


Thanks in advance!

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Sep 2010 22:02
Try

save bitmap "myscreen.jpg",0

That should save the main screen as a jpg .

Enjoy your day.
Cyborg ART
19
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 20th Sep 2010 23:02
But how do I get the cameras view into the bitmap in an easy way?

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Sep 2010 23:22
The camera's view is already in bitmap 0 - but you'll need to find the save bitmap function (it's not a built-in DBPro command).
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 21st Sep 2010 01:53
Quote: "but you'll need to find the save bitmap function (it's not a built-in DBPro command)."

Really? It's a DBC command though - I thought that one would carry over.

Quote: "But how do I get the cameras view into the bitmap in an easy way?"

The main screen where everything is drawn and displayed is BITMAP 0 . So if you save bitmap 0, you are capturing the screen.

Is there a Save Image command ? If so try

make memblock from bitmap 1,0
make image from memblock 1,1
save image "myscreen.jpg",1

That may be a little slower because of the conversions back and forth, but should be pretty straight forward.

You could also just save the memblock before making an image from it (but after converting bitmap 0 to the memblock) and convert it to an image later when you need it instead of saving the image itself.

Enjoy your day.

Login to post a reply

Server time is: 2026-07-22 12:41:32
Your offset time is: 2026-07-22 12:41:32