Thema: Delphi Eigenen Brush Style

Einzelnen Beitrag anzeigen

Benutzerbild von Meflin
Meflin

Registriert seit: 21. Aug 2003
4.856 Beiträge
 
#2

Re: Eigenen Brush Style

  Alt 5. Jul 2007, 14:13
Du kannst deinem TBrush ein Bitmap als BrushStyle übergeben
Delphi-Quellcode:
var
  Bitmap: TBitmap;
begin
  Bitmap := TBitmap.Create;
  try
    Bitmap.LoadFromFile('MyBitmap.bmp');
    Form1.Canvas.Brush.Bitmap := Bitmap;
    Form1.Canvas.FillRect(Rect(0,0,100,100));
  finally
    Form1.Canvas.Brush.Bitmap := nil;
    Bitmap.Free;
  end;
end;
  Mit Zitat antworten Zitat