I am trying to add a layer to an ImgView32, and on that layer I want to draw a line. But, I want that layer to be transparent, so it wont cover all the layers added previously. So I want to obtain:
layer 1 -> image
layer 2 -> another image
layer 3 -> draw a line
layer 4 -> another image
This is a following to question: Delphi Graphics32 how to draw a line with the mouse on a layer You will find the code that I use for drawing the line and declaring the BitmapLayer following the link. I do not want to add it here so the question will remain small.
Btw, I already tried to declare this for the drawing layer:
Bitmap.DrawMode := dmBlend;
BL.Bitmap.CombineMode:= cmMerge;
also this
Bitmap.DrawMode := dmTransparent;
BL.Bitmap.CombineMode:= cmMerge;
(BL -> The TBitmapLayer) No change. When I create the BitmapLayer, it sits ontop of the previous layers just like a white paper, hiding them. The question is: can this be done (making the layer transparent)? Then how?
Thank you
Here's a sample code, based on previous test. Maybe better post whole unit this time, including also the .dfm. The Memo and Button are just part of my usual test setup, not needed to demonstrate GR32.
First the .dfm:
And then the .pas:
As you see from the .dfm, I have set the background of ImgView to lime color. I also drew a rectangle and some text to show the transparency.
In SwapBuffers I tried TransparentBlt and seems to work. Outcommented is also direct assigning of bm32 to the layer bitmap, which also works, but may not always be what you want.