PathResourceConverter klass
Innehåll
[
Dölj
]Summary: Converts PathResource to GraphicsPath and vice versa.
Module: aspose.imaging.fileformats.tiff.pathresources
Full Name: aspose.imaging.fileformats.tiff.pathresources.PathResourceConverter
Methods
| Name | Description |
|---|---|
| from_graphics_path(graphics_path, image_size) | Konverterar GraphicsPath instansen till sökvägsresurser. |
| to_graphics_path(path_resources, image_size) | Konverterar sökvägsresurser till GraphicsPath instansen. |
Method: from_graphics_path(graphics_path, image_size) [static]
from_graphics_path(graphics_path, image_size)
Konverterar GraphicsPath instansen till sökvägsresurser.
Parameters:
| Parameter | Typ | Beskrivning |
|---|---|---|
| graphics_path | GraphicsPath | Grafikvägen. |
| image_size | Size | Bildens storlek. |
Returns
| Typ | Beskrivning |
|---|---|
| PathResource[] | Sökvägsresurserna. |
Method: to_graphics_path(path_resources, image_size) [static]
to_graphics_path(path_resources, image_size)
Konverterar sökvägsresurser till GraphicsPath instansen.
Parameters:
| Parameter | Typ | Beskrivning |
|---|---|---|
| path_resources | PathResource[] | Sökvägsresurserna. |
| image_size | Size | Bildens storlek. |
Returns
| Typ | Beskrivning |
|---|---|
| GraphicsPath | Den GraphicsPath instansen. |
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:
# Skapa GraphicsPath med PathResources från TIFF-bild
active_frame = image.active_frame
graphics_path = PathResourceConverter.to_graphics_path(active_frame.path_resource, active_frame.size)
graphics = Graphics(image)
# Rita en röd linje och spara bilden
graphics.draw_path(Pen(Color.red, 10), graphics_path)
image.save("BottleWithRedBorder.tif")