Adding A Background Image Directly To A Form

Click to select the code.  Use Control-C to copy it to your clipboard. Help


Attaching a background image directly to a form is easy; and a much less cumbersome alternative to using an image component stuck behind all your other controls.  Essentially you just create the TBitmap when the form is created, load the image from a file, then paint it onto the canvas.  (Don't forget to free the TBitmap at the end when the form is destroyed, as shown!)

Especially useful with 'containerless' forms (no titlebar or borders), with a little graphical ingenuity, you can create great-looking applications.  Since the image file is external, and loaded when the application starts, it also means you can change the 'skin' of the application simply by changing the image graphic.


Copyright 2001 - 2012 by and OECCorp.
The 2012 Evolution™ is an OEC InterNET Group site.SupportNotices