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

New Post: What happens with Copyopacity in version 7

$
0
0
this is the class that I run to get all the results.
please do not forget to change the path of the two file to your local drive


class Class1
{
    public void ConvertPictures()
    {
        var cropImagePath = @"d:\temp\BlackWithSquare.png";
        var userSamplePicturePath = @"d:\temp\userSample.jpg";

        using (var userSamplePicture = new MagickImage(userSamplePicturePath))
        {
            using (var blackImage = new MagickImage(cropImagePath))
            {
                blackImage.Resize(userSamplePicture.Width, userSamplePicture.Height);
                foreach (CompositeOperator op in Enum.GetValues(typeof(CompositeOperator)))
                {
                    try
                    {
                        using (var temp = new MagickImage(userSamplePicture))
                        {
                            temp.Composite(blackImage, Gravity.Center, op);
                            temp.Write(@"d:\temp\test_" + op + ".png");
                        }
                    }
                    catch (Exception e)
                    {
                        continue;
                    }
                }
            }
        }
    }

}

Viewing all articles
Browse latest Browse all 3693

Trending Articles



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