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.

posted on 2008-06-11 10:32  万一  阅读(1981)  评论(0编辑  收藏  举报