Вот как можно самому нарисовать градиент (ширина PaintBox1 = 2x256 для простоты):
Код:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | type
TForm1 = class (TForm)
PaintBox1: TPaintBox;
procedure PaintBox1Paint(Sender: TObject);
private
public
end ;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1 . PaintBox1Paint(Sender: TObject);
var
i: Integer ;
R: TRect;
begin
R:= Rect( 0 , 0 , 1 , PaintBox1 . Height);
for i:= 0 to 255 do
begin
PaintBox1 . Canvas . Brush . Color:= (( $FF - i) shl 16 ) + (i);
PaintBox1 . Canvas . FillRect(R);
OffsetRect(R, 1 , 0 );
end ;
for i:= 0 to 255 do
begin
PaintBox1 . Canvas . Brush . Color:= ( $FF - i) + (i shl 8 );
PaintBox1 . Canvas . FillRect(R);
OffsetRect(R, 1 , 0 );
end ;
end ;
|