Classe PathResourceConverter
Contenuti
[
Nascondere
]Summary: Converts PathResource to GraphicsPath and vice versa.
Module: aspose.imaging.fileformats.tiff.pathresources
Full Name: aspose.imaging.fileformats.tiff.pathresources.PathResourceConverter
Methods
| Name | Descrizione |
|---|---|
| from_graphics_path(graphics_path, image_size) | Converte l’istanza GraphicsPath in risorse di percorso. |
| to_graphics_path(path_resources, image_size) | Converte le risorse di percorso nell’istanza GraphicsPath. |
Method: from_graphics_path(graphics_path, image_size) [static]
from_graphics_path(graphics_path, image_size)
Converte l’istanza GraphicsPath in risorse di percorso.
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| graphics_path | GraphicsPath | Il percorso grafico. |
| image_size | Size | Dimensione dell’immagine. |
Returns
| Tipo | Descrizione |
|---|---|
| PathResource[] | Le risorse di percorso. |
Method: to_graphics_path(path_resources, image_size) [static]
to_graphics_path(path_resources, image_size)
Converte le risorse di percorso nell’istanza GraphicsPath.
Parameters:
| Parametro | Tipo | Descrizione |
|---|---|---|
| path_resources | PathResource[] | Le risorse di percorso. |
| image_size | Size | Dimensione dell’immagine. |
Returns
| Tipo | Descrizione |
|---|---|
| GraphicsPath | L’istanza GraphicsPath. |
Examples
Create Graphics Path from Path Resources in TIFF image.
import aspose.pycore as aspycore
from aspose.imaging import Image, Graphics, Color, Pen
from aspose.imaging.fileformats.tiff import TiffImage
from aspose.imaging.fileformats.tiff.pathresources import PathResourceConverter
with aspycore.as_of(Image.load("Bottle.tif"), TiffImage) as image:
# Crea il GraphicsPath usando PathResources da immagine TIFF
active_frame = image.active_frame
graphics_path = PathResourceConverter.to_graphics_path(active_frame.path_resource, active_frame.size)
graphics = Graphics(image)
# Disegna una linea rossa e salva l'immagine
graphics.draw_path(Pen(Color.red, 10), graphics_path)
image.save("BottleWithRedBorder.tif")