You need a windowed control (that is, a control with a window handle, or a "proper" control) to display your message, because a non-windowed control cannot be visible above a windowed control. The easiest solution is to place the TImage
in a TPanel
and set Image1.Align := alClient
and Panel1.BorderStyle := bsNone
.
If you wish to draw a semi-transparent bitmap on top of your ordinary controls, you can do like 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;