HOME

Sample to draw text into an image with Delphi and GdPicture ActiveX

 

uses
ComObj; // In Delphi 6 also include the Variants unit

procedure TForm1.Button1Click(Sender: TObject);
var
Imaging: Variant;
begin
Imaging := CreateOleObject('gdpicturepro5.imaging');
Imaging.SetLicenseNumber ("0012345678910111213141516"); //Demo code version
Imaging.CreateNewImage(1024, 768, 32);

//Draw Hello World! at position 200, 200 (pixel) with Red Arial Bold Font

Imaging.DrawText('Hello World!', 200, 200, 12, 1, Imaging.ARGB(255,255, 0, 0), "Arial");
Imaging.SaveAsJpeg('c:\test.jpeg');
Imaging := Unassigned;
end;