LinearColors //屬性; 獲取或設置漸變的起始色和結束色.
Rectangle //屬性; 獲取定義漸變的起始點和終結點的矩形區域.
WrapMode //屬性; 獲取或設置 WrapMode 枚舉, 指定畫刷環繞模式; 感覺它沒有存在的必要.
TranslateTransform //方法; 平移.
ScaleTransform //方法; 放縮.
RotateTransform //方法; 旋轉.
Transform //屬性; 矩陣變換.
MultiplyTransform //方法: 矩陣變換.
下面是僅就 RotateTransform 方法做的一個測試:
測試代碼:
uses GdiPlus;
procedure TForm1.FormPaint(Sender: TObject);
const
C1 = $FF000000;
C2 = $FFFF0000;
C3 = $FFFFFF00;
C4 = $FFFF0000;
C5 = $FF000000;
var
Graphics: IGPGraphics;
Rect: TGPRect;
Brush: IGPLinearGradIEntBrush;
ColorBlend: IGPColorBlend;
begin
Graphics := TGPGraphics.Create(Canvas.Handle);
Rect.Initialize(ClIEntRect);
Brush := TGPLinearGradIEntBrush.Create(Rect, 0, 0, 0);
ColorBlend := TGPColorBlend.Create([C1, C2, C3, C4, C5], [0, 0.25, 0.5, 0.75, 1]);
Brush.InterpolationColors := ColorBlend;
Brush.RotateTransform(30);
Graphics.FillRectangle(Brush, Rect);
end;
procedure TForm1.FormResize(Sender: TObject);
begin
Repaint;
end;