Leadtools.Codecs Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
SizeMode Property
See Also 
Leadtools.Codecs Namespace > CodecsRasterizeDocumentLoadOptions Class : SizeMode Property



Gets or sets a value that indicate the transformation to use when converting the logical size specified in PageWidth and PageHeight to the final physical raster image size.

Syntax

Visual Basic (Declaration) 
Public Property SizeMode As CodecsRasterizeDocumentSizeMode
Visual Basic (Usage)Copy Code
Dim instance As CodecsRasterizeDocumentLoadOptions
Dim value As CodecsRasterizeDocumentSizeMode
 
instance.SizeMode = value
 
value = instance.SizeMode
C# 
public CodecsRasterizeDocumentSizeMode SizeMode {get; set;}
C++/CLI 
public:
property CodecsRasterizeDocumentSizeMode SizeMode {
   CodecsRasterizeDocumentSizeMode get();
   void set (CodecsRasterizeDocumentSizeMode value);
}

Return Value

A CodecsRasterizeDocumentSizeMode enumeration member that indicate the transformation to use when converting the logical size specified in PageWidth and PageHeight to the final physical raster image size. Default value is CodecsRasterizeDocumentSizeMode.None.

Example

For an example, refer to CodecsRasterizeDocumentLoadOptions.

Remarks

LEADTOOLS provides support for loading a document as a raster image. Documents formats such as PDF, XPS, XLS, RTF and Text do not contain physical width, height or resolution. It is up to the loader (in this case, the RasterCodecs object) to specify the transformation from logical coordinates to physical pixels through a process called rasterization. For more information, refer to CodecsRasterizeDocumentLoadOptions.

You can use the SizeMode property to control how to use PageWidth and PageHeight to control the final raster image size. LEADTOOLS will determine the original document size (a value that can be obtained in CodecsDocumentImageInfo.PageWidth and CodecsDocumentImageInfo.PageHeight and then apply the transfromation from this value to determine the final RasterImage width and height as follows:

CodecsRasterizeDocumentLoadOptions.SizeModeDescription
CodecsRasterizeDocumentSizeMode.None

Use the original document width and height. No transformation will be performed and CodecsRasterizeDocumentLoadOptions.PageWidth and CodecsRasterizeDocumentLoadOptions.PageHeight are not used.

The final RasterImage will have a width or height value equals to the original document size.

CodecsRasterizeDocumentSizeMode.Fit

Fit the result raster image into CodecsRasterizeDocumentLoadOptions.PageWidth and CodecsRasterizeDocumentLoadOptions.PageHeight while maintaining the aspect ratio. If the original document size is smaller than the requested page size, no transformation is performed.

The final RasterImage will have a width or height equal to or less than the requested page width or height but not greater.

CodecsRasterizeDocumentSizeMode.FitAlways

Always fit the result raster image into CodecsRasterizeDocumentLoadOptions.PageWidth and CodecsRasterizeDocumentLoadOptions.PageHeight while maintaining the aspect ratio. If the original document size is smaller than the requested page size, then the result image is scaled up.

The final RasterImage will have a width or height equal to the requested page width or height. Not less and not greater.

CodecsRasterizeDocumentSizeMode.FitWidth

Fit the result raster image width into CodecsRasterizeDocumentLoadOptions.PageWidth while maintaining the aspect ratio. The image height will be calculated based on the transformation and CodecsRasterizeDocumentLoadOptions.PageHeight is not used.

The final RasterImage will have a width equal to the requested page width. The height depends on the original document height.

CodecsRasterizeDocumentSizeMode.Stretch

The result raster image width and height will be exactly equal to CodecsRasterizeDocumentLoadOptions.PageWidth and CodecsRasterizeDocumentLoadOptions.PageHeight. Aspect ratio might be different than the original document.

The final RasterImage will have a width and height equal to the requested page width and height.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also