//紋理畫刷
WrapMode 選項:
var
g: TGPGraphics;
img: TGPImage;
tb: TGPTextureBrush;
begin
g := TGPGraphics.Create(Canvas.Handle);
img := TGPImage.Create('c:tempsmall.jpg');
tb := TGPTextureBrush.Create(img);
g.FillEllipse(tb, 0, 0, Self.ClientWidth, Self.ClIEntHeight);
img.Free;
tb.Free;
g.Free;
end;
//Matrix
var
g: TGPGraphics;
img: TGPImage;
tb: TGPTextureBrush;
matrix: TGPMatrix;
begin
g := TGPGraphics.Create(Canvas.Handle);
img := TGPImage.Create('c:tempx.jpg');
tb := TGPTextureBrush.Create(img);
matrix := TGPMatrix.Create(75.0/640.0, 0.0, 0.0, 75.0/480.0, 0.0, 0.0);
tb.SetTransform(matrix);
g.FillEllipse(tb, 0, 0, Self.ClientWidth, Self.ClIEntHeight);
matrix.Free;
img.Free;
tb.Free;
g.Free;
end;
//WrapMode
var
g : TGPGraphics;
img: TGPImage;
tb : TGPTextureBrush;
p: TGPPen;
begin
g := TGPGraphics.Create(Canvas.Handle);
img := TGPImage.Create('c:tempsmall.jpg');
tb := TGPTextureBrush.Create(img);
p := TGPPen.Create(MakeColor(255, 0, 0, 0));
tb.SetWrapMode(WrapModeTile);
g.FillRectangle(tb, MakeRect(0, 0, 200, 200));
g.DrawRectangle(p, MakeRect(0, 0, 200, 200));
tb.SetWrapMode(WrapModeTileFlipX);
g.FillRectangle(tb, MakeRect(200, 0, 200, 200));
g.DrawRectangle(p, MakeRect(200, 0, 200, 200));
tb.SetWrapMode(WrapModeTileFlipY);
g.FillRectangle(tb, MakeRect(0, 200, 200, 200));
g.DrawRectangle(p, MakeRect(0, 200, 200, 200));
tb.SetWrapMode(WrapModeTileFlipXY);
g.FillRectangle(tb, MakeRect(200, 200, 200, 200));
g.DrawRectangle(p, MakeRect(200, 200, 200, 200));
img.Free;
tb.Free;
p.Free;
g.Free;
end;