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 / Drawing to multiple Bitmaps

Author
Message
MasterChief
20
Years of Service
User Offline
Joined: 1st Jan 2004
Location: Washington, USA
Posted: 19th Aug 2005 19:38
Here is another Bitmap question/problem. I've looked at many threads, but could not find a close resolution...

I need to establish 3 or more bitmaps roughly 100 x 200 pixels in size. Then place them at specific locations on Bitmap 0 (the screen)and draw to them individually using "Set Current Bitmap x".

When I "Make Bitmap" it seems to place each new bitmap at 0,0 (upper left and upper top) of the main screen and on top of each other.

How do I make bitmap and then position it?
Writing to each should be easy by referencing it with "Set Current Bitmap".

I have found that I can only draw to the Bitmap of interest by calculated coordinates based on the distances from left and top of the main screen.

Thanks in advance!
Doyle
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 19th Aug 2005 20:15 Edited at: 19th Aug 2005 20:16
Once you have created a bitmap, you should then use the Load Image command instead of Load Bitmap.

You can then Paste Image at any X,Y position on the newly created bitmap.

TDK_Man

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 20th Aug 2005 15:14
It is possible though.

first load bitmap. (>0 cause 0 = screen)
then:

copy bitmap from-bitmap,left,top,right,bottom,to-bitmap,left,top,right,bottom

This is often used to blur "up". Because the default blur goes right-down or stays at 1 position.

Immunity and Annihalation makes Immunihalation...
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 20th Aug 2005 19:52
Just as a footnote, the basic idea of creating bitmaps is to have hidden screens which you can draw to in the background without being seen by the user. That's why you have only 32 of them.

What you are doing, the Image commands were designed for - and you can have thousands of them! The fact that Windows images are also called bitmaps (bmp's) is what causes the confusion.

If I understand what you are saying correctly, I suggest you create just 1 bitmap (say number 1) and load/create whatever image you need on that positioned at 0,0.

When done, you use Get Image 1,0,0,100,200 or whatever the size is.

Use CLS and repeat the process to create the other two images (also on bitmap 1 but grabbed into Images 2 and 3).

You then have Images 1, 2 and 3 which you can then paste onto screen 0 at any location whenever you need to.

When you need to update any of them, paste them onto the hidden screen at 0,0 then update them and grab them again - all unseen by the user.

Alternatively, create the whole of your main screen on the scond bitmap and update it as required, copying the bitmap to 0 when finished. You then won't see the screen update and wach of the three images will be positioned the same as on the main screen.

TDK_Man

Login to post a reply

Server time is: 2024-09-24 03:15:11
Your offset time is: 2024-09-24 03:15:11