unit FON;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
Row: integer;
procedure OnIdleProc(Sender: TObject; var Done: Boolean);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnIdle := OnIdleProc;
end;
procedure TForm1.OnIdleProc(Sender: TObject; var Done: Boolean);
var
i: integer;
col: TColor;
Gray: integer;
begin
for i := 0 to Form1.ClientWidth - 1 do
begin
col := Form1.Canvas.Pixels[i, Row];
Gray := GetRValue(col) + round(30 * sin(i / 30 + Row / 50));
Form1.Canvas.Pixels[i, Row] := RGB(Gray, Gray, Gray);
end;
inc(Row);
if (Row = Form1.ClientHeight) then
Row := 0;
Done := false;
end;
end.
Копирайт © 2007, Lanselot. Все права защищены.