I have a Window with a property pict as Picture
I’m trying to draw the Window into the Picture.
Works fine with the following code in the Open event of the picture
pict = New Picture( self.Width, self.Height, 32)
self.DrawInto pict.Graphics, 0, 0
However if the Window has a custom colour background (e.g. golden), then the picture does not have that custom colour (its background is white).
I have the feeling I’m missing something fundamental here.
Anyone can give me a clue?
You are right, background color does not show.
You can put a color on the back of a window that will show with DrawInto by painting it.
This in the window Paint event does the trick :
g.ForeColor = &c80000000
g.fillrect(0,0,me.width,me.height)
or
pict = New Picture( self.Width, self.Height, 32)
pict.Graphics.ForeColor = self.BackColor
pict.Graphics.FillRect 0, 0, pict.Width, pict.Height
self.DrawInto pict.Graphics, 0, 0
Fantastic! I’m a very happy camper and can finally go to bed
Thank you both.