Setting up background images for forms in Delphi -
How can I load an image to my program and make it a background for a form? I need the exact code for that I have seen all over the internet and all the things I have found is a lot of changes, and there are fixes for background work for the purpose of special circumstances. I have also tried some Delphi books. And I have not found it anywhere.
-
Place a
TImage
on your form. Make sure all other controls on the form are behind you can right-click it and select "Send back" menu option. -
Load a graphic.
var img: TBitmap; Start IMG: = TBitmap Create; Try img.LoadFromFile ('s: \ background.bmp');
-
Assign it to image control.
Image 1 Image: = img;
-
Clear.
img.Free at the end; End; End;
You can also add the last three steps to load the graphic and put it in the image control at a time. Thanks for John for the suggestion.
Image1.Picture.LoadFromFile ('B: \ background.bmp');
See also:
Comments
Post a Comment