AutoSize: Boolean;
The AutoSize property determines whether the control is automatically resized to fit size of the image placed in it.
If the value is True, the control is automatically resized to fit the image size, if the value is False, the control is not resized.
The default property value is False.
Executing the example requires a regular report with the REGULAR_REPORT identifier, which sheet contains an image. Add links to the Metabase, Report, Tab, Drawing system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Report: IPrxReport;
Sheet: IPrxTable;
Image: IPrxPicture;
Pict: IGxImage;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("REGULAR_REPORT").Edit;
Report := MObj As IPrxReport;
Sheet := Report.Sheets.Item(0) As IPrxTable;
Image := Sheet.TabSheet.Objects.Item(0).Extension As IPrxPicture;
Pict := GxImage.FromFile("C:\Logo.jpg");
Image.Image := Pict;
Image.AutoSize := True;
Image.Center := True;
Image.Proportional := False;
Image.Stretch := False;
MObj.Save;
End Sub Main;
The regular report image is replaced with the image specified in the original size, the image is centered, saving of proportions and stretching the image to the size of the control, in which it was set, are disabled.
See also: