unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, GR32, GR32_Image, GR32_Transforms, GR32_Resamplers,
GR32_Layers, ExtCtrls, Buttons, ComCtrls, Grids, GR32_RangeBars;
type
TForm1 =
class(TForm)
Image321: TImage32;
Button1: TButton;
Image322: TImage32;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure createImg32(
var ziel:TImage32; color:Integer);
var leer:TBitmap32;
begin
leer := TBitmap32.Create;
leer.SetSize(ziel.Width, ziel.Height);
leer.Canvas.Brush.Color := color;
leer.Canvas.Rectangle(-1, -1, ziel.Width+2, ziel.Height+2);
ziel.Bitmap.Assign(leer);
end;
procedure createBmp32Layer(
var ziel:TBitmapLayer; Image: TImage32; color, breite, hoehe:Integer);
var leer:TBitmap32;
layer:TBitmapLayer;
begin
ziel:=TBitmapLayer.Create(Image.Layers);
leer := TBitmap32.Create;
leer.SetSize(breite, hoehe);
leer.Canvas.Brush.Color := color;
leer.Canvas.Rectangle(-1, -1, breite+2, hoehe+2);
ziel.Bitmap.Assign(leer);
end;
procedure TForm1.Button1Click(Sender: TObject);
var layer:TBitmapLayer;
leer:TBitmap32;
begin
Image321.Bitmap.LineToFS(100, 100);
Image321.Bitmap.Textout(100, 100, '
HALLOWELT');
createBmp32Layer(layer, Image321, clred, 30, 100);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
createImg32(Image321, clgreen);
end;
end.