Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: add white bars/background wider than a portrait image (centering the photo)

$
0
0
So the above example I couldn't get to work as it threw an error on the string "xc:red", but I think what it was suppose to do was create a red 'portrait sized' image with white bars 300px in width on each side, correct?

I have implemented the following for my case and I am not having much luck changing the image at all so I assume I am just doing something wrong...
Private staticvoid ForceLetterbox(MagickImage image)
{
    Using (MagickImage portrait = new MagickImage(MagickColor.Transparent, image.Width, image.Height))
    {
          Portrait.Extent(300, 300, Gravity.Center, new MagickColor("White"));
          Image.Composite(portrait, Gravity.Center, CompositeOperator.DstIn);
    }
}
Sorry for the improper syntax/formatting, typed on a tiny keyboard...

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>