PathResourceConverter Klasse
Inhalt
[
Ausblenden
]Summary: Converts PathResource to GraphicsPath and vice versa.
Module: aspose.imaging.fileformats.tiff.pathresources
Full Name: aspose.imaging.fileformats.tiff.pathresources.PathResourceConverter
Methods
| Name | Beschreibung |
|---|---|
| from_graphics_path(graphics_path, image_size) | Konvertiert die GraphicsPath Instanz zu Pfadressourcen. |
| to_graphics_path(path_resources, image_size) | Konvertiert Pfadressourcen zur GraphicsPath Instanz. |
Method: from_graphics_path(graphics_path, image_size) [static]
from_graphics_path(graphics_path, image_size)
Konvertiert die GraphicsPath Instanz zu Pfadressourcen.
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| graphics_path | GraphicsPath | Der Grafikpfad. |
| image_size | Size | Größe des Bildes. |
Returns
| Typ | Beschreibung |
|---|---|
| PathResource[] | Die Pfadressourcen. |
Method: to_graphics_path(path_resources, image_size) [static]
to_graphics_path(path_resources, image_size)
Konvertiert Pfadressourcen zur GraphicsPath Instanz.
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| path_resources | PathResource[] | Die Pfadressourcen. |
| image_size | Size | Größe des Bildes. |
Returns
| Typ | Beschreibung |
|---|---|
| GraphicsPath | Die GraphicsPath Instanz. |
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:
# Erstelle den GraphicsPath mithilfe von PathResources aus einem TIFF-Bild
active_frame = image.active_frame
graphics_path = PathResourceConverter.to_graphics_path(active_frame.path_resource, active_frame.size)
graphics = Graphics(image)
# Zeichne eine rote Linie und speichere das Bild
graphics.draw_path(Pen(Color.red, 10), graphics_path)
image.save("BottleWithRedBorder.tif")