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


TGPTextureBrush.Create(

  image: TGPImage; {用于画刷的图像}

);


 
   
本例效果图:

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

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.


 
   

你可能感兴趣的:(text)