RasterImage.Crop

Crop(Rectangle)

지정된 사각형을 자릅니다.

public virtual void Crop(Rectangle rectangle)
모수유형설명
rectangleRectangle직사각형.

다음 코드 예제는 이미지를 자르고 저장하는 방법을 보여줍니다.

[C#]

// PSD 파일에 대한 올바른 자르기 방법을 구현합니다.
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 });
}

또한보십시오


Crop(int, int, int, int)

시프트로 이미지 자르기.

public virtual void Crop(int leftShift, int rightShift, int topShift, int bottomShift)
모수유형설명
leftShiftInt32왼쪽 교대.
rightShiftInt32오른쪽 교대.
topShiftInt32최고 교대.
bottomShiftInt32하단 이동.

또한보십시오