Link to home
Start Free TrialLog in
Avatar of koger
koger

asked on

Background Picture on form.

How to use a bitmap as a background picture on a form in Delphi 2
ASKER CERTIFIED SOLUTION
Avatar of ZifNab
ZifNab

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ZifNab
ZifNab

Hi koger,

To fully answer your question fully :

 add in the public section of your form :
  bmpBackground : TBitmap;

 add in the formcreate event following code :
  bmpBackground := TBitmap.Create;
  bmpBackground.LoadFromFile( 'c:\windows\setup.bmp' );

 add code in the onpaint event :
  Canvas.Draw( 0, 0, bmpBackground );

 offcourse we've to free the memmory of our bitmap, so add following code in the formdestroy event :
  bmpBackground.Free;

Zif