how can I draw while in setbuffer imagebuffer() ?

Blitz3D Forums/Blitz3D Programming/how can I draw while in setbuffer imagebuffer() ?

dman(Posted 2010) [#1]
I want to show the image on the screen while using the setbuffer imagebuffer() and CopyRect to capture the image.

when I use it the screen goes blank.

Is there away to grab and show the image at the same time ?


thanks


Matty(Posted 2010) [#2]
I'm sure there is, and I'd like to help but I don't really understand what you are trying to do? The screen won't display the image until you flip it into view, and it will only display what is on the backbuffer, however there's on reason you cannot copy from the backbuffer to an imagebuffer before flipping the backbuffer into view.


_Skully(Posted 2010) [#3]
Well, you have to setbuffer imagebuffer(image), do your drawing, then setbuffer backbuffer() to use drawimage etc


_PJ_(Posted 2010) [#4]
The screen only EVER shows the "frontbuffer"

When any other buffer is set as the current GraphicsBuffer() then the results of your drawing will not appear on screen, since the buffer used is simply a 'virtual' screen in memory.

To ensure your images are displayed, you need to use DrawImage.

Note, that it's recommended to draw to the "Backbuffer" an, when all drawing is completed, sue the FLIP command to replace the "Frontbuffer" with the "backbuffer", so your "backbuffer" (and all drawings) are then displayed on-screen. This is known as Double-Buffering, and ensures that your screen is all updated at once.

Doing so will also clear the "backbuffer", so rememeber to re-draw anything that needs it.