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.

Dark GDK / Bitmap operations?

Author
Message
Elspin
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 19th May 2008 22:32
I was trying to use the basic2d funcitons to draw to a bitmap, but I noticed the said bitmap is not drawn to the screen. If I set the current bitmap to 0 (the screen) it draws fine, but does not on the current bitmap. Below is the code that works, but draws to the screen and not a bitmap.



Below is the code that does not work.



and in fact, will prevent any form of visual effects on the screen including any print operations or inputs from dbInput... can anyone help me with this odd problem?
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 20th May 2008 00:07 Edited at: 20th May 2008 00:09
It's working, its just drawing to bitmap 1 instead of 0. Remember, bitmap 0 is the screen so anything you draw there you will automatically see. If you draw to any other bitmap you will not see what you've done unless you tell that bitmap to draw.

Bitmaps are generally for very specific purposes and may not be for what you are intending, but if it is what you want then you can copy the contents of bitmap 1 to bitmap 0 to display it.

dbCopyBitmap(1, 0);

will copy the whole contents of bitmap 1 onto 0 (the screen).

Another version of the function exists which is:

void dbCopyBitmap ( int iFrom, int iLeft, int iTop, int iRight, int iBottom, int iTo, int iLeft, int iTop, int iRight, int iBottom )

that allows you to specify a rectangle on each bitmap to copy from and to. so you could copy the top left of bitmap1 to the bottom right of bitmap 0, as just one example.

Edit:

incidently, if you use dbGetImage() you can specify part of the /currently set bitmap/ to be turned into an "image". You can use the dbImage type commands with the result and can even turn them into sprites, etc.

Elspin
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 20th May 2008 01:37
Thanks for the help, I was wondering if it had something to do with copying to the screen.

Login to post a reply

Server time is: 2024-11-20 11:45:18
Your offset time is: 2024-11-20 11:45:18