Equivalent of distort:viewport=WxH+X+Y

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
tom_dl
Posts: 43
Joined: 2015-02-26T08:25:44-07:00
Authentication code: 6789

Equivalent of distort:viewport=WxH+X+Y

Post by tom_dl »

Magick.NET version 7.0.7.700-Q16-x64

I'm distorting an image with

Code: Select all

MagickImage.Distort(ImageMagick.DistortMethod, double[])
which is working fine, except I can't work out how to apply distort "options" like the following CLI versions:

Code: Select all

-set distort:viewport=WxH+X+Y
or

Code: Select all

-set distort:scale=value
What am I missing here?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Equivalent of distort:viewport=WxH+X+Y

Post by dlemstra »

I just published a new release (7.1.0.0) that includes a new class called DistortSettings that you could use to set the viewport.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
tom_dl
Posts: 43
Joined: 2015-02-26T08:25:44-07:00
Authentication code: 6789

Re: Equivalent of distort:viewport=WxH+X+Y

Post by tom_dl »

That's awesome. Thanks for doing the work!
lq634254672
Posts: 5
Joined: 2018-07-06T21:08:17-07:00
Authentication code: 1152

Re: Equivalent of distort:viewport=WxH+X+Y

Post by lq634254672 »

dlemstra wrote: 2017-11-12T11:46:05-07:00 I just published a new release (7.1.0.0) that includes a new class called DistortSettings that you could use to set the viewport.
How do I this in Magick++ using function? I am not find distortsetting class in magick++.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Equivalent of distort:viewport=WxH+X+Y

Post by dlemstra »

You can do this (in C++):

Code: Select all

image.artifact("distort:viewport","your value");
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply