KitchenDraw SDK 2
Show / Hide Table of Contents

Method ExportImage

ExportImage(bool, ViewMode, string, int, int, string, bool, int, int)

Exports an image corresponding to the object.

Declaration
public bool ExportImage(bool opened, Scene.ViewMode viewMode, string filename, int xRes, int yRes, string backgroundColor, bool transparent, int jpegQuality, int antialiasing)
Parameters
Type Name Description
bool opened

Specifies whether object is shown closed or opened.

Scene.ViewMode viewMode

Specifies the view mode to generate.

string filename

Specifies the image filename (with extension; and with full path if necessary).

int xRes

Horizontal resolution (pixels) of the exported image.

int yRes

Vertical resolution (pixels) of the exported image.

string backgroundColor

Background color of the image. If you use System.Drawing.Color to store color values, you can use String.Format("{0},{1},{2}", color.R, color.G, color.B) expression to get the color string for this method. If this parameter is empty, the background will be white.

bool transparent

Specifies whether the background of the image should be transparent. This parameter is ignored if filename extension specifies the image format that doesn't support transparency. The backgroundColor parameter is ignored if you specify true for transparent and the image format supports transparency.

int jpegQuality

Specifies the JPEG compression quality from 0 to 10, where 0 is the best compression and 10 is the best quality. Ignored for any other image format then JPEG.

int antialiasing

Specifies the antialiasing level implemented to reduce the stairs effect on the oblique lines. 1 means no antialiasing. 2 means that the image is generated with a resolution of xRes2 out of yRes2 then an average on 4 pixels is carried out. For speed reasons, it’s not advised to use an anti-aliasing level higher than 3.

Returns
Type Description
bool

true if the image was successfully generated, false otherwise.

Remarks

The generated file can be a .JPG, .BMP, .GIF, .PNG or .TIF file, the format depends on the filename extension specified in the filename parameter.

In this article
Back to top Generated by DocFX