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 / opening and closing several bmps

Author
Message
psylent letterz
19
Years of Service
User Offline
Joined: 8th Oct 2006
Location:
Posted: 29th Jan 2007 20:47
How can you have several bitmaps at the same time?

I want to do something like this:

Open a .bmp then open another .bmp then add them together to create a third bmp and save the third.

I cant figure it out.

Can someone help?
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 29th Jan 2007 22:21
You are confusing the terminology slightly.

The file called 'MyPhoto.bmp' on your hard disk is a bitmap file - a 'Windows bitmap'.

In DB, a screen is called a bitmap to differentiate it from the image commands.

By default DB uses bitmap 0 - the screen you actually see on the monitor, but when you create Bitmap 1, it creates another screen which you can't actually see.

You use Set Current Bitmap to switch to working on another bitmap while you are still looking at screen 0, but when you create another bitmap of any number DB automatically switches to drawing to that screen.

That's why if you create a bitmap 2, you have to use Set Current Bitmap 0 afterwards - even though you didn't have to say Set Current Bitmap 2 before.

So, if you need to work with 3 Windows bitmaps (images) you create 3 DB Bitmaps (screens) and use Set Current Bitmap to the correct one before loading the image from disk, reading or writing to the screen.

Just remember to set the current bitmap back to 0 when you've finished or you won't be able to write anything to the screen you actually see.

TDK_Man

Login to post a reply

Server time is: 2026-07-06 10:39:47
Your offset time is: 2026-07-06 10:39:47