Top controls like TPanel?

My program runs a lot of time, and I would like to show TImage in the middle of the application window, but it will not stay on top - my VST is always on top. However, when I use TPanel, does it stay on top? How can I do my TImage?

In fact, the solution that applies to all controls will be great :)

Thanks!

0
source share
2 answers

You need a window control (that is, a control with a window handle or a β€œcorrect” control) to display your message, because a non-window control cannot be visible above the window control. The easiest solution is to put the TImage in the TPanel and set Image1.Align := alClient and Panel1.BorderStyle := bsNone .

If you want to draw a translucent bitmap on top of your regular controls, you can do as I always do:

 procedure TForm1.Button1Click(Sender: TObject); var bm: TBitmap; png: TPngImage; begin // The form contains a hidden TPanel (somewhere on the form) // with a TImage (alClient). // png is a PNG image with an alpha channel png := TPngImage.Create; try png.LoadFromFile('C:\Users\Andreas Rejbrand\Pictures\alpha.png'); // Create bitmap of form and blend PNG on it bm := GetFormImage; try bm.Canvas.Draw(0, 0, png); Image1.Picture.Bitmap := bm; finally bm.Free; end; Panel1.Align := alClient; Panel1.BringToFront; Panel1.Show; finally png.Free; end; end; 

Sample result

+7
source

TImage does not have a window associated with it and what is the difference between it and the panel.

Add a panel and place the image inside the panel, i.e. the parent of the image is the panel. You can then bring the image to the front by bringing the panel to the front panel.

Do you think you are hiding your VST?

+1
source

Source: https://habr.com/ru/post/954296/


All Articles