unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    procedure FormPaint(Sender: TObject);
    procedure FormResize(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
uses
  GDIPOBJ,GDIPAPI;
procedure TForm1.FormPaint(Sender: TObject);
var
  g:TGPGraphics;
  tb:TGPTextureBrush;
  img:TGPImage;
begin
  Form1.DoubleBuffered:=True;
  g:=TGPGraphics.Create(Canvas.Handle);
  g.Clear(aclWhite);
  img:=TGPImage.Create('d:\mm.jpg');
  tb:=TGPTextureBrush.Create(img);

  g.FillEllipse(tb,0,0,Self.ClientWidth,Self.ClientHeight);

  tb.Free;
  img.Free;
  g.Free;
end;

procedure TForm1.FormResize(Sender: TObject);
begin
  Repaint;
end;

end.

posted on 2010-12-31 11:04  巅枫  阅读(597)  评论(0编辑  收藏  举报