procedure AddPicture(Picture: TPicture; X, Y: Double);
| Picture | TPicture. The source picture object to embed. The graphic inside Picture doğal boyutta dönüştürülür ve sayfaya yerleştirilir (şuradan türetilen Picture.Width / Picture.Height in pixels, mapped to PDF user units). |
procedure AddPicture(Picture: TPicture; X, Y, Width, Height: Double);
| Picture | TPicture. The source picture object to embed. The graphic is scaled to fit the specified Width × Height rectangle on the page. |
AddPicture embeds the graphic held in a TPicture nesnesini geçerli PDF sayfasına yerleştirir. Üç koordinatlı biçim resmi doğal boyutunda yerleştirirken, beş koordinatlı biçim onu açık bir Width × Height rectangle.
TPicture kayıtlı herhangi bir grafik biçimi için standart VCL/LCL kapsayıcısıdır. Biçime özgü olmadığı için bitmap'ler, PNG görüntüleri, JPEG görüntüleri veya yüklenmiş herhangi bir başka grafiği aktarabilirsiniz TPicture instance. For placing a plain TBitmap directly, consider AddImage instead. For raw JPEG stream data, use AddJpegImage.
The X and Y parameters define the lower-left corner of the image in PDF user units (origin at page lower-left, Y increases upward). When Width and Height atlanırsa yerleştirme boyutu, 72 DPI varsayılarak resmin piksel boyutlarından türetilir
var
Pic: TPicture;
begin
Pic := TPicture.Create;
try
Pic.LoadFromFile('C:\Images\chart.png');
// Place at natural size, lower-left at (72, 500)
Pdf1.AddPicture(Pic, 72, 500);
// Or scale to an explicit 300 x 200 pt rectangle
Pdf1.AddPicture(Pic, 72, 200, 300, 200);
finally
Pic.Free;
end;
end;