Class ImageSaveOptions

Info

Options for saving image.

public class ImageSaveOptions : SaveOptions

Inheritance

objectSaveOptionsImageSaveOptions

Inherited Members

Constructors

ImageSaveOptions()

public ImageSaveOptions()

Properties

HorizontalResolution

Gets or sets the horizontal resolution for generated images, in dots per inch.

public int HorizontalResolution { get; set; }

Property Value

int

Remarks

The default value is 96.

Setting Sheetize.ImageSaveOptions.HorizontalResolution and Sheetize.ImageSaveOptions.VerticalResolution effects the width and height of the output image in pixels.

ImageType

Gets or sets the format of the generated images. Default value is Sheetize.ImageType.Png.

public ImageType ImageType { get; set; }

Property Value

ImageType

OnePagePerSheet

If OnePagePerSheet is true, all content of one sheet will output to only one page in result. The paper size defined by PageSetup will be ignored, but other settings of PageSetup still takes effect.

public bool OnePagePerSheet { get; set; }

Property Value

bool

VerticalResolution

Gets or sets the vertical resolution for generated images, in dots per inch.

public int VerticalResolution { get; set; }

Property Value

int

Remarks

The default value is 96.

Setting Sheetize.ImageSaveOptions.HorizontalResolution and Sheetize.ImageSaveOptions.VerticalResolution effects the width and height of the output image in pixels.

Methods

Finish(Stream)

Finish writing data to the stream.
By default this method just closes the stream directly(including the situation that the stream is the one specified by Sheetize.SaveOptions.OutputStream).
User may overwrite this method to control how to release resources according to their requirement and the implementation of Sheetize.ImageSaveOptions.GetStream(System.Int32).

public virtual void Finish(Stream stream)

Parameters

  • stream Stream: the stream that has finished its task(saving data to)

GetStream(int)

Gets stream to save the image.

public virtual Stream GetStream(int pageIndex)

Parameters

  • pageIndex int: the page to render to image

Returns

Stream : Stream for writing generated image to.

Remarks

By default, if Sheetize.SaveOptions.OutputStream has been specified and takes effect, then this method returns the specified Stream always. User should overwrite this method in his own implementation of this class to provide different and proper Stream objects for multi-pages output.
If Sheetize.SaveOptions.OutputFile has been specified and takes effect, if there is only one page of image, then the specified path(file) will be used directly as the output; otherwise the page index will be appended to the file name and then return the FileStream build from the file. For example, if output path is specified as res.png, then the generated images will be res0.png, res1.png, …

Namespace: Sheetize Assembly: Sheetize.dll

 English