Class MagicWandSettings

Class MagicWandSettings

名称: Aspose.Imaging.MagicWand アセンション: Aspose.Imaging.dll (25.4.0)

A Magic Wand Selection Settings クラス

public class MagicWandSettings

Inheritance

object MagicWandSettings

相続人

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ツールを使用して画像の複雑な領域を選択し、マスク(インバート、ユニオン、サブストラクト)と相互作用する能力を示しています。

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(int、 int)

Aspose.Imaging.MagicWand.MagicWandSettingsクラスの新しい例を開始します。

public MagicWandSettings(int x, int y)

Parameters

x int

参照点のXコーディネート。

y int

参照点の y 調整点

Properties

AreaOfInterest

アルゴリズム作業のための領域の範囲を取得または設定します。

public Rectangle AreaOfInterest { get; set; }

不動産価値

Rectangle

ColorCompareMode

アルゴリズムは、色がどのように比較されるかを取得または設定します。

public ColorComparisonMode ColorCompareMode { get; set; }

不動産価値

ColorComparisonMode

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; }

不動産価値

bool

DirectionalMode

検索アルゴリズムを満たす洪水モードを取得または設定する: 検索方向の8つから4つ。

public FloodFillDirectionalMode DirectionalMode { get; set; }

不動産価値

FloodFillDirectionalMode

Point

アルゴリズム作業の参照点を取得または設定します。

public Point Point { get; }

不動産価値

Point

Threshold

ピクセル色の比較のための耐性レベルを取得または設定します。

public int Threshold { get; set; }

不動産価値

int

 日本語