|
Delphi
Tutorial Graphics - Show varies flowers as user move mouse. Flower
are changed randomly as user move mouse. All the images are stored
in ImageList components.
Download this example
Use system timer to put flowers randomly on desktop.
procedure
TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
{
Clear the previous image }
Image1.Picture:=Image2.Picture;
{
Randomly assigned a image from image list
GetBitmap
- Retrieves a specified image as a bitmap.}
ImageList1.GetBitmap(Random(10),
Image1.Picture.Bitmap);
{
Set new image position at cursor }
Image1.Top
:= Y - Round(Image1.Height / 2);
Image1.Left
:= X - Round(Image1.Width / 2);
end;
DOWNLOAD this example
Click
here
to download this complete example for Delphi 6. (File size 317KB)

|