您的位置:首页 > 其它

再学 GDI+[19]: TGPTextureBrush(纹理画刷)

2008-06-11 10:32 323 查看
TGPTextureBrush.Create(
image: TGPImage; {用于画刷的图像}
);

本例效果图:



unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;

type
TForm1 = class(TForm)
procedure FormPaint(Sender: TObject);
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

uses GDIPOBJ, GDIPAPI;

procedure TForm1.FormPaint(Sender: TObject);
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;

end.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: