type
TRGBTripleArray = packed array[Word] of TRGBTriple;
pRGBTripleArray = ^TRGBTripleArray;
{...}
procedure TForm1.FormCreate(Sender: TObject);
var
X, Y: Integer;
R, G, B: Byte;
{Color: Cardinal;}
ColorRow: pRGBTripleArray;
begin
CreateColorSet;
ActiveColorSet:=0;
MainX:=0;
MainY:=0;
Randomize;
DoubleBuffered:=True;
R:=0;
G:=0;
B:=0;
BMP:=TBitmap.Create;
BMP.Width:=Screen.Width;
BMP.Height:=Screen.Height;
BMP.PixelFormat:=pf24Bit;
for Y:=0 to BMP.Height-1 do
begin
ColorRow:=BMP.ScanLine[Y];
for X:=0 to BMP.width-1 do
begin
{Below code can be modified in various ways, resulting very nice images,
just change operators.}
R:= Round(255 * Sin(2 * Pi * (Byte(X+Y) - 174) / 255));
G:= Round(255 * Sin(2 * Pi * (Byte(X+Y) - 17) / 255));
B:= Round(255 * Sin(2 * Pi * (Byte(X+Y) - 57) / 255));
ColorRow[X].rgbtBlue:=B;
ColorRow[X].rgbtGreen:=G;
ColorRow[X].rgbtRed:=R;
end;
end;
end;
Users browsing this forum: Bing [Bot] and 11 guests