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