Class MagicWandSettings
이름 공간 : Aspose.Imaging.MagicWand 모임: Aspose.Imaging.dll (25.4.0)
마법의 밴드 선택 설정 클래스.
public class MagicWandSettings
Inheritance
상속 회원들
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
예제는 Magic Wand 도구를 사용하여 모든 픽셀의 톤과 색상에 따라 이미지의 간단한 영역을 선택하는 방법을 보여줍니다.
var imageFilePath = "input.png";
using (RasterImage image = (RasterImage)Image.Load(inputFilePath))
{
// Create a new mask using magic wand tool based on tone and color of pixel (120, 100) with custom threshold equal to 150
MagicWandTool
.Select(image, new MagicWandSettings(120, 100) { Threshold = 150 })
// Apply mask to the image
.Apply();
// Save image with forced transparency color type option
image.Save(outputFilePath, new ImageOptions.PngOptions()
{
ColorType = PngColorType.TruecolorWithAlpha
});
}
예제는 Magic Wand 도구를 사용하여 이미지의 복잡한 영역을 선택하는 방법과 마스크와 상호 작용 할 수있는 능력을 보여줍니다 (invert, union, substract).
var imageFilePath = "input.png";
using (RasterImage image = (RasterImage)Image.Load(inputFilePath))
{
// Create a new mask using magic wand tool based on tone and color of pixel (845, 128)
MagicWandTool.Select(image, new MagicWandSettings(845, 128))
// Union the existing mask with the specified one created by magic wand tool
.Union(new MagicWandSettings(416, 387))
// Invert the existing mask
.Invert()
// Subtract the specified mask created by magic wand tool with specified threshold from the existing one
.Subtract(new MagicWandSettings(1482, 346) { Threshold = 69 })
// Subtract four specified rectangle masks from the existing mask one by one
.Subtract(new RectangleMask(0, 0, 800, 150))
.Subtract(new RectangleMask(0, 380, 600, 220))
.Subtract(new RectangleMask(930, 520, 110, 40))
.Subtract(new RectangleMask(1370, 400, 120, 200))
// Feather mask with specified settings
.GetFeathered(new FeatheringSettings() { Size = 3 })
// Apply mask to the image
.Apply();
// Save image
image.Save(outputFilePath);
}
Constructors
MagicWandSettings(Point)
Aspose.Imaging.MagicWand.MagicWandSettings 클래스의 새로운 예를 시작합니다.
public MagicWandSettings(Point point)
Parameters
point
Point
참조 포인트 입니다.
MagicWandSettings(이트, 이트)
Aspose.Imaging.MagicWand.MagicWandSettings 클래스의 새로운 예를 시작합니다.
public MagicWandSettings(int x, int y)
Parameters
x
int
참조 포인트의 x 조정.
y
int
참조 포인트의 Y 조정.
Properties
AreaOfInterest
알고리즘 작업을위한 영역의 경계를 얻거나 설정합니다.
public Rectangle AreaOfInterest { get; set; }
부동산 가치
ColorCompareMode
색상이 어떻게 비교되는지 알고리즘을 얻거나 설정합니다.
public ColorComparisonMode ColorCompareMode { get; set; }
부동산 가치
ColorComparisonDelegate
사용자 지정 색상 비교 알고리즘을 얻거나 설정하면 Aspose.Imaging.MagicWand.MagicWandSettings.ColorCompareMode는 Aspose.Imaging.MagicWand.ColorComparisonMode.Custom으로 설정됩니다.
public MagicWandSettings.ColorComparison ColorComparisonDelegate { get; set; }
부동산 가치
MagicWandSettings . ColorComparison
ContiguousMode
마법 밴드가 단지 고정된 픽셀만을 정의할 것인지 여부를 나타내는 값을 얻거나 설정합니다.
public bool ContiguousMode { get; set; }
부동산 가치
DirectionalMode
수신 또는 홍수 모드를 설정 검색 알고리즘을 채우십시오 : 8 방향 검색의 4 개.
public FloodFillDirectionalMode DirectionalMode { get; set; }
부동산 가치
Point
알고리즘 작업을위한 참조 포인트를 얻거나 설정합니다.
public Point Point { get; }
부동산 가치
Threshold
픽셀 색상 비교에 대한 관용 수준을 얻거나 설정합니다.
public int Threshold { get; set; }