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.

Newcomers DBPro Corner / [DBP] Bitmaps? Images?

Author
Message
Parkey
17
Years of Service
User Offline
Joined: 1st Mar 2007
Location:
Posted: 2nd Mar 2007 14:25
Probably a silly question but...

There are "Bitmaps" in DarkBASIC.

There are "Images" in DarkBASIC.

What's the difference, and how do they relate to each other?
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 2nd Mar 2007 16:25 Edited at: 2nd Mar 2007 16:29
Load Bitmap in DB should be read as Load 'Screen' so a DB bitmap is not the same as a Windows bitmap.

When you load a bitmap, you have to supply a bitmap (or screen) number. This is a number between 1 and 32.

When you do, a hidden screen is created and the specified image loaded into it - while you are still looking at screen 0 which is the one which appears on your monitor.

Once the image is loaded, all screen operations - such as Get Image/Paste Image etc - are directed to that hidden screen so you don't see it happening.

When finished, you can use Set Current Bitmap 0 to switch back to working on the main screen and either delete the other bitmap or leave it there to grab more images later on.

You can also use a hidden bitmap screen to build an image instead of loading something into it - for example you can create images for sprites with text on them on the fly and without the process being seen.

If you know the image you want is the correct size, you should use Load Image because it cuts out all the steps outlined above.

TDK_Man

Login to post a reply

Server time is: 2024-11-25 22:39:22
Your offset time is: 2024-11-25 22:39:22