随笔 - 2146  文章 - 97 评论 - 11765 trackbacks - 253

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 万一 阅读(...) 评论(...) 编辑 收藏