You can set the TransparentColor
property of the form to True, and then set the form color to the same TransparentColorValue
, and the entire client area of ββthe form will be transparent. If the Delphi version you are using does not have the TransparentColor [Value] properties, you can achieve the same result with API calls:
Color := clBlack; SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) or WS_EX_LAYERED ); SetLayeredWindowAttributes(Handle, 0, 255, LWA_COLORKEY);
will make the transparency of the client area forms. You can draw on canvas as usual:
procedure TForm1.FormPaint(Sender: TObject); begin Canvas.Font.Color := clWhite; Canvas.TextOut(0, 0, 'Text'); end;
Of course, you can also put a shortcut in the form with a font color other than transparent.
source share