WmfRasterizationOptions Class
Contents
[
Hide
]Summary: The Wmf rasterization options.
Module: aspose.imaging.imageoptions
Full Name: aspose.imaging.imageoptions.WmfRasterizationOptions
Inheritance: MetafileRasterizationOptions
Constructors
Name | Description |
---|---|
WmfRasterizationOptions() | Initializes a new instance of the WmfRasterizationOptions class. |
Properties
Name | Type | Access | Description |
---|---|---|---|
background_color | Color | r/w | Gets or sets a background color. |
border_x | float | r/w | Gets or sets the border X. |
border_y | float | r/w | Gets or sets the border Y. |
center_drawing | bool | r/w | Gets or sets a value indicating whether center drawing. |
draw_color | Color | r/w | Gets or sets a foreground color. |
page_height | float | r/w | Gets or sets the page height. If the value is 0, the source image aspect ratio will be preserved. |
page_size | SizeF | r/w | Gets or sets the page size. If one of SizeF dimensions is 0, the source image aspect ratio will be preserved. |
page_width | float | r/w | Gets or sets the page width. If the value is 0, the source image aspect ratio will be preserved. |
positioning | PositioningTypes | r/w | Gets or sets the positioning. |
render_mode | WmfRenderMode | r/w | Gets or sets the WMF render mode. |
smoothing_mode | SmoothingMode | r/w | Gets or sets the smoothing mode. |
text_rendering_hint | TextRenderingHint | r/w | Gets or sets the text rendering hint. |
Methods
Name | Description |
---|---|
clone() | Creates a new object that is a shallow copy of the current instance. |
copy_to(vector_rasterization_options) | Copies this to vectorRasterizationOptions. |
Constructor: WmfRasterizationOptions()
WmfRasterizationOptions()
Initializes a new instance of the WmfRasterizationOptions class.
Property: render_mode
Gets or sets the WMF render mode.
See also:
Example # 1: This example shows how to load a WMF image from a file and convert it to SVG …
Method: clone()
clone()
Creates a new object that is a shallow copy of the current instance.
Returns
Type | Description |
---|---|
System.Object | A new object that is a shallow copy of this instance. |
Method: copy_to(vector_rasterization_options)
copy_to(vector_rasterization_options)
Copies this to vectorRasterizationOptions.
Parameters:
Parameter | Type | Description |
---|---|---|
vector_rasterization_options | VectorRasterizationOptions | vectorRasterizationOptions |
Examples
This example shows how to load a WMF image from a file and convert it to SVG using WmfRasterizationOptions.
from aspose.pycore import as_of, cast
from aspose.imaging import Image, Color, SizeF
from aspose.imaging.fileformats.wmf import WmfImage, WmfRenderMode
from aspose.imaging.imageoptions import SvgOptions, WmfRasterizationOptions
# Using Aspose.Imaging.Image.Load is a unified way to load all types of images including WMF.
with as_of(Image.load("test.wmf") as image:
saveOptions = SvgOptions()
# Text will be converted to shapes.
saveOptions.text_as_shapes = True
rasterizationOptions = WmfRasterizationOptions()
# The background color of the drawing surface.
rasterizationOptions.background_color = Color.white_smoke
# The page size.
rasterizationOptions.page_size = cast(SizeF, wmfImage.size)
# If embedded emf exists, then render emf; otherwise render wmf.
rasterizationOptions.render_mode = WmfRenderMode.AUTO
saveOptions.vector_rasterization_options = rasterizationOptions
wmfImage.save("test.output.svg", saveOptions)