PixelHeight: Integer;
PixelHeight: Integer;
The PixelHeight property determines the height of the image after export.
The size of image on export is set using the following algorithm:
Actual width and height of the image are calculated in accordance with the distance from uppermost left top to the lowermost right top of the shape.
The following correlations are calculated:
Calculated width and value of the PixelWidth property.
Calculated height and value of the PixelHeight property.
In case of maximum correlation the size value is scaled to keep the image proportions.
By default, the PixelHeight property is set to 0, the exported image has the calculated height.
Executing the example requires a form with the Button1 button, the WorkspaceBox component named WorkspaceBox1 and a data source for it.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Exp: IWxViewExporter;
Begin
Exp := New WxViewExporter.Create;
Exp.WxView := WorkspaceBox1.View;
Exp.PixelHeight := 500;
Exp.PixelHeight := 300;
Exp.ExportToFile("C:\WS.jpg", "JPG");
End Sub Button1OnClick;
On clicking the button the workspace displayed in the WorkspaceBox1 is exported. On export the size of the final image is set. One of the sizes is scaled to keep the image proportions if required.
Executing the example requires a .NET form with the Button1 button, the WorkspaceBoxNet component named WorkspaceBoxNet1 and a data source for it.
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Exp: WxViewExporter = New WxViewExporter();
Begin
Exp.WxView := WorkspaceBoxNet1.View;
Exp.PixelHeight := 500;
Exp.PixelHeight := 300;
Exp.ExportToFile("C:\WS.jpg", "JPG");
End Sub;
On clicking the button the workspace displayed in the WorkspaceBoxNet1 is exported. On export the size of the final image is set. One of the sizes is scaled to keep the image proportions if required.
See also: