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.

  1. 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.

  2. Load a graphic.

      var img: TBitmap; Start IMG: = TBitmap Create; Try img.LoadFromFile ('s: \ background.bmp');  
  3. Assign it to image control.

      Image 1 Image: = img;  
  4. 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

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -