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 / How to make a bitmap or image from the screen.

Author
Message
Sedit
6
Years of Service
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 12th Dec 2017 23:36
I know it can be done I cant for the life remember how though.

I have a map that is static and never changes and instead of drawing it to the screen every cycle it would be much better for me to just store it as a bitmap and past it to the screen once every cycle.
Sphere sphere = new Sphere(0.5f);
InsanelyRedundantJava insanelyredundantjava = new InsanelyRedundantJava(Redundancy1, Redundancy2);
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Dec 2017 00:01
Either get image (if that's a command) or I think you have to use ImageKit. I can't recall for sure, it's been so long.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 14th Dec 2017 05:00 Edited at: 14th Dec 2017 05:15
Using Get Image is probably a good straight forward way to do this. However drawing to screen then copying the contents is sloppy.
The process of creating the image should not be visible on the screen. You should do this in memory only. Here is how you can use the BITMAP feature to achieve this.



Doing it this way will simplify your code, reduce the possibility of bugs, and reduce the chance of visible graphics glitches. So in your code you only draw the map with that prepared image, if the image does not exist then you create the image and on the next frame you try again. Or you create the image when loading a menu or a level.

3D objects can also be rendered and incorporated into this process with clever use of additional cameras rendering to images.

Login to post a reply

Server time is: 2024-04-20 04:47:57
Your offset time is: 2024-04-20 04:47:57