VectorRasterizationOptions Sınıfı

Summary: The vector rasterization options.
Please note that VectorRasterizationOptions will no longer derive from ImageOptionsBase
since aspose.imaging 24.12 version.

Module: aspose.imaging.imageoptions

Full Name: aspose.imaging.imageoptions.VectorRasterizationOptions

Constructors

NameAçıklama
VectorRasterizationOptions()VectorRasterizationOptions sınıfının yeni bir örneğini başlatır.

Properties

NameTypeAccessAçıklama
background_colorColorr/wArka plan rengini alır veya ayarlar.
border_xfloatr/wSınır X’i alır veya ayarlar.
border_yfloatr/wSınır Y’yi alır veya ayarlar.
center_drawingboolr/wOrta çizim olup olmadığını gösteren bir değeri alır veya ayarlar.
draw_colorColorr/wÖn plan rengini alır veya ayarlar.
page_heightfloatr/wSayfa yüksekliğini alır veya ayarlar.
Değer 0 ise, kaynak görüntünün en‑boy oranı korunur.
page_sizeSizeFr/wSayfa boyutunu alır veya ayarlar.
Eğer SizeF boyutlarından biri 0 ise, kaynak görüntünün en‑boy oranı korunur.
page_widthfloatr/wSayfa genişliğini alır veya ayarlar.
Değer 0 ise, kaynak görüntünün en‑boy oranı korunur.
positioningPositioningTypesr/wKonumlandırmayı alır veya ayarlar.
smoothing_modeSmoothingModer/wYumuşatma modunu alır veya ayarlar.
text_rendering_hintTextRenderingHintr/wMetin renderleme ipucunu alır veya ayarlar.

Methods

NameAçıklama
clone()Geçerli örneğin yüzeysel bir kopyası olan yeni bir nesne oluşturur.
copy_to(vector_rasterization_options)Kopyalar.

Constructor: VectorRasterizationOptions()

 VectorRasterizationOptions() 

VectorRasterizationOptions sınıfının yeni bir örneğini başlatır.

Property: background_color

Arka plan rengini alır veya ayarlar.

See also:

Example # 1: This example shows how to load a WMF image from a file and convert it to SVG …

Property: page_size

Sayfa boyutunu alır veya ayarlar.
Eğer SizeF boyutlarından biri 0 ise, kaynak görüntünün en‑boy oranı korunur.

See also:

Example # 1: This example shows how to load a WMF image from a file and convert it to SVG …

Property: positioning

Konumlandırmayı alır veya ayarlar.

See also:

Example # 1: The following example shows how to set a memory limit when loading a CMX imag…

Example # 2: The following example shows how to export all pages of CDR document to PDF.

Method: clone()

 clone() 

Geçerli örneğin yüzeysel bir kopyası olan yeni bir nesne oluşturur.

Returns

TürAçıklama
System.ObjectBu örneğin yüzeysel bir kopyası olan yeni bir nesne.

Method: copy_to(vector_rasterization_options)

 copy_to(vector_rasterization_options) 

Kopyalar.

Parameters:

ParameterTürAçıklama
vector_rasterization_optionsVectorRasterizationOptionsVektör rasterleştirme seçenekleri.

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

# Aspose.Imaging.Image.Load kullanmak, WMF dahil tüm görüntü türlerini yüklemenin birleşik bir yoludur.
with as_of(Image.load("test.wmf") as image:
	saveOptions = SvgOptions()
	# Metin şekillere dönüştürülecek.
	saveOptions.text_as_shapes = True
	rasterizationOptions = WmfRasterizationOptions()
	# Çizim yüzeyinin arka plan rengi.
	rasterizationOptions.background_color = Color.white_smoke
	# Sayfa boyutu.
	rasterizationOptions.page_size = cast(SizeF, wmfImage.size)
	# Gömülü emf varsa, emf işlenir; aksi takdirde wmf işlenir.
	rasterizationOptions.render_mode = WmfRenderMode.AUTO
	saveOptions.vector_rasterization_options = rasterizationOptions
	wmfImage.save("test.output.svg", saveOptions)

The following example shows how to set a memory limit when loading a CMX image. The memory limit is the maximum allowed size (in megabytes) for all internal buffers.

from aspose.imaging import Image, TextRenderingHint, SmoothingMode, PositioningTypes, LoadOptions
from aspose.imaging.imageoptions import PngOptions, CmxRasterizationOptions
import os

directory = "c:\\aspose.imaging\\issues\\net\\3419\\"
	
# Hedef yüklenen görüntü için 10 megabayt bellek sınırı ayarlanıyor.
load_options = LoadOptions()
load_options.buffer_size_hint = 10
with Image.load(os.path.join(directory, "example.cmx"), load_options) as image:
	png_options = PngOptions()
	cmx_spec = CmxRasterizationOptions()
	cmx_spec.text_renderingHint = TextRenderingHint.SINGLE_BIT_PER_PIXEL
	cmx_spec.smoothing_mode = SmoothingMode.ANTI_ALIAS
	cmx_spec.positioning = PositioningTypes.DEFINED_BY_DOCUMENT
	png_options.vector_rasterization_options = cmx_spec
	image.save(os.path.join(directory, "output.png"), png_options)

The following example shows how to export all pages of CDR document to PDF.

from aspose.imaging import Image, TextRenderingHint, SmoothingMode
from aspose.imaging.imageoptions import PdfOptions, CdrRasterizationOptions, PositioningTypes
from os.path import join

dir_: str = "c:\\3570"
input_cdr_file_name: str = join(dir_, "tiger.cdr")
output_pdf_file_name: str = join(dir_, "tiger.cdr.pdf")
with Image.load(input_cdr_file_name) as image:
	pdf_options = PdfOptions()
	rasterization_options = CdrRasterizationOptions()
	rasterization_options.text_rendering_hint = TextRenderingHint.SINGLE_BIT_PER_PIXEL
	rasterization_options.smoothing_mode = SmoothingMode.NONE
	rasterization_options.positioning = PositioningTypes.DEFINED_BY_DOCUMENT
	pdf_options.vector_rasterization_options = rasterization_options
	image.save(output_pdf_file_name, pdf_options)