|
Delphi Tutorial Graphics - Click anywhere on the desktop it will
show a flower at mouse position. Basically what this program does
is using full screen transparent form, put a transparent bitmap
image on mouse position. Once you go through this program you may
amaze how easy to write this program. .
Use following commands to make transparent form and hide the image
at start up.
procedure
TForm1.FormCreate(Sender: TObject);
begin
{
Set transparent background }
Brush.Style:=bsClear;
{
Hide image at start up }
Image1.Visible
:= False;
end;
This one put the flower (bitmap image) at mouse position.
procedure
TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
{
Show image at current cursor position }
Image1.Top
:= Y - Round(Image1.Height / 2);
Image1.Left
:= X - Round(Image1.Width / 2);
Image1.Visible
:= True;
end;
See
how simple is to code this program – Enjoy the power of
Delphi programming . . .
DOWNLOAD this example
Click
here
to download this complete example for Delphi 6. (File size 39KB)

|