Texture painting Brush
Var
G:tgpgraphics;
Img:tgpimage;
Tb:tgptexturebrush;
Begin
G: = Tgpgraphics.create (Canvas.handle);
IMG: = tgpimage.create (' c:\temp\small.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:\temp\x.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:\temp\small.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
WrapMode option:
| Delphi |
Microsoft |
Description |
| Wrapmodeclamp |
Clamp |
The texture or gradient is not tiled. |
| Wrapmodetile |
Tile |
Tile a gradient or texture. |
| Wrapmodetileflipx |
Tileflipx |
Water to rehabilitate a texture or gradient, and then tile the texture or gradient. |
| Wrapmodetileflipxy |
Tileflipxy |
Invert the texture or gradient horizontally and vertically, and then tile the texture or gradient. |
| Wrapmodetileflipy |
Tileflipy |
Invert the texture or gradient vertically, and then tile the texture or gradient. |