ImageMagick.Drawables.PushClipPath C# (CSharp) Метод

PushClipPath() публичный Метод

Creates a new DrawablePushClipPath instance.
public PushClipPath ( string clipPath ) : Drawables
clipPath string The ID of the clip path.
Результат Drawables
    public Drawables PushClipPath(string clipPath)
    {
      _Drawables.Add(new DrawablePushClipPath(clipPath));
      return this;
    }

Usage Example

Пример #1
0
            private void SetClipMask(IMagickImage image, int x0, int y0, int x1, int y1)
            {
                var drawables = new ImageMagick.Drawables();

                var paths = drawables.Paths()
                            .MoveToAbs(x0, y0)
                            .LineToAbs(x1, y0)
                            .LineToAbs(x1, y1)
                            .LineToAbs(x0, y1)
                            .LineToAbs(x0, y0);

                var pathId = nameof(SetClipMask);

                drawables
                .PushClipPath(pathId)
                .Path(paths)
                .PopClipPath()
                .ClipPath(pathId)
                .Draw(image);
            }