RasterImage.Crop
Contents
[
Hide
]Crop(Rectangle)
Crops the specified rectangle.
public virtual void Crop(Rectangle rectangle)
Parameter | Type | Description |
---|---|---|
rectangle | Rectangle | The rectangle. |
Examples
The following code example shows how to crop an image and save it.
[C#]
// Implement correct Crop method for PSD files.
string sourceFileName = "1.psd";
string exportPathPsd = "CropTest.psd";
string exportPathPng = "CropTest.png";
using (RasterImage image = Image.Load(sourceFileName) as RasterImage)
{
image.Crop(new Rectangle(10, 30, 100, 100));
image.Save(exportPathPsd, new PsdOptions());
image.Save(exportPathPng, new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
}
See Also
- struct Rectangle
- class RasterImage
- namespace Aspose.PSD
- assembly Aspose.PSD
Crop(int, int, int, int)
Crop image with shifts.
public virtual void Crop(int leftShift, int rightShift, int topShift, int bottomShift)
Parameter | Type | Description |
---|---|---|
leftShift | Int32 | The left shift. |
rightShift | Int32 | The right shift. |
topShift | Int32 | The top shift. |
bottomShift | Int32 | The bottom shift. |
See Also
- class RasterImage
- namespace Aspose.PSD
- assembly Aspose.PSD