home *** CD-ROM | disk | FTP | other *** search
- unit Main;
-
- { Program copyright (c) 1995 by Charles Calvert }
- { Project Name: PIXELS }
-
- { This program shows how to draw the smallest
- possible visual object to the screen, which
- is a pixel. Also shows something about the
- Windows coordinate system, and about using
- the RGB function to access the colors available
- on your system. }
-
- interface
-
- uses
- WinTypes, WinProcs,
- Classes, Graphics,
- Controls, Printers, Forms;
-
- type
- TForm1 = class(TForm)
- procedure FormPaint(Sender: TObject);
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- procedure TForm1.FormPaint(Sender: TObject);
- var
- R: TRect;
- i: Integer;
- Color: LongInt;
- begin
- R := GetClientRect;
- for i := 1 to 10000 do begin
- Color := RGB(Random(255), Random(255), Random(255));
- Canvas.Pixels[Random(R.Right), Random(R.Bottom)] := Color;
- end;
- end;
-
- end.
-