// Texture painter 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;
// Matrixvar 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;
// Wrapmodevar 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. fig (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 options:
Delphi |
Microsoft |
description |
wrapmodeclamp |
clamp |
the texture or gradient is not tiled. |
wrapmodetile |
tile |
tiled gradient or texture. |
wrapmodetileflipx |
tileflipx |
reverse the texture or gradient horizontally, and tile the texture or gradient. |
wrapmodetileflipxy |
tileflipxy |
reverse the texture or gradient horizontally and vertically, and then tile the texture or gradient. |
wrapmodetileflipy |
tileflipy |
reverse the texture or gradient vertically, and tile the texture or gradient. |