Recent

Author Topic: BGRALayeredBitmap use with BGRAVirtualScreen  (Read 3241 times)

evoshroom

  • Full Member
  • ***
  • Posts: 157
BGRALayeredBitmap use with BGRAVirtualScreen
« on: July 21, 2012, 09:02:57 pm »
How do I assign BGRALayeredBitmap to a BGRAVirtualScreen so that I can modify it at runtime (such as moving layers around and adjusting their transparency)?  PutImage() and BGRAVirtualScreen.Bitmap don't seem right for this, as they have no properties for layers, but I'm probably missing something.  How is this supposed to be handled? 

Again, I'm porting things from Graphics32 but the basic Image32 (whose use is somewhat analogous to a BGRAVirtualScreen) has a Image32.Layer property, so you could do Image32.Layer[0].Bitmap.MasterAlpha := 255; and whatnot.  How is this handled in BGRA?

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: BGRALayeredBitmap use with BGRAVirtualScreen
« Reply #1 on: July 21, 2012, 10:58:50 pm »
Layers are not embedded in BGRAVirtualScreen.

To do what you want to do, you just need to define the OnRedraw event of the BGRAVirtualScreen (in the event tab, double-click on this event).

In the method, draw the layers on the Bitmap :
Code: [Select]
Layers.Draw(Bitmap,0,0);
Then, when you modify your layers, in order to reflect the changes on the form, call BGRAVirtualScreen.RedrawBitmap.
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018