Board index » cppbuilder » Permanant Background Question

Permanant Background Question

Is there a way to paint a permanant background onto a form?
Permanant meaning that the background would not have to be redrawn when
another window is moved in front of it.
 

Re:Permanant Background Question


I dont think so, or at least I have never heard or seen it...... but thats
no guarantee ;o)
The best choice is probably the brush, but it goes to a max of 8*8 bitmaps I
think..... pretty unusable anyway.

If you are worried about system performance, and needs to draw the
background yourself, you can allways kill the default Windows drawing, and
save some time....

Lars

Quote
Pin Tan wrote in message <793kkl$d...@forums.borland.com>...
>Is there a way to paint a permanant background onto a form?
>Permanant meaning that the background would not have to be redrawn when
>another window is moved in front of it.

Re:Permanant Background Question


I don't think so. Windows system can't recreate what itself has destryed, an
dthat's what happens when a form is moved in front of another form.

Pin Tan a crit dans le message <793kkl$d...@forums.borland.com>...

Quote
>Is there a way to paint a permanant background onto a form?
>Permanant meaning that the background would not have to be redrawn when
>another window is moved in front of it.

Re:Permanant Background Question


Quote
Pin Tan wrote:
> Is there a way to paint a permanant background onto a form?
> Permanant meaning that the background would not have to be redrawn when
> another window is moved in front of it.

As I understand it, even if the form is a standard form, the form surface
and all the controls are redrawn when covered by another window and then
uncovered.  If you want a 'permanent' background, you will have to use the
OnPaint event to make sure it is repainted when covered and then
uncovered.  I have used the OnPaint event of a PaintBox to refresh the
print preview of a data logging form, and it works pretty well

You could also put a TImage on the form, and set its Align property to
alClient.  Then set its Picture to the image you want. You may have to move
it to the back, but I think all the controls would be drawn on top of it
regardless.

Hope this helps,
Alan McIntyre
a...@norfolkgraphics.com
http://norfolkgraphics.com

Other Threads