Mawg
Mawg

Reputation: 40149

How to give a form a static background picture from JPEG and place controls over it?

How to give a form a static background picture from JPEG and place controls over parts of it?

Upvotes: 1

Views: 886

Answers (2)

Rob Kennedy
Rob Kennedy

Reputation: 163287

Put a TImage on your form. Assign its Picture property. Put your other controls on top of it.

Upvotes: 5

Robert
Robert

Reputation: 878

This might be an easy solution for you:

  • Load the JPEG at Form.OnCreate
  • Set TForm.DoubleBuffered to True (in Form.OnCreate)
  • In Form.OnPaint Event Handler draw/tile the picture over the form (Canvas.Draw, the TJPEGPicture should somewehere export a TGraphic which you can use for Draw()ing)
  • Place TImage/TPaintBox (without images/OnPaint handlers) objects at the according locations and assign OnClick handlers

Upvotes: 2

Related Questions