I converted it to JPG, and save it.
I then edit the JPG copy, and I tried the code at the top of this post on that test image, and it had a huge white border. So I realize I must resize it.
I then I tried this code, on that test image. And it blurred. What am I missing here? Something in this process is blurring it.
using (MagickImage resize = new MagickImage(folder + filename))
I then edit the JPG copy, and I tried the code at the top of this post on that test image, and it had a huge white border. So I realize I must resize it.
I then I tried this code, on that test image. And it blurred. What am I missing here? Something in this process is blurring it.
using (MagickImage resize = new MagickImage(folder + filename))
{
Single DPIChangeRatio = Convert.ToSingle(density) / Convert.ToSingle(res.X);
resize.VirtualPixelMethod = VirtualPixelMethod.Transparent;
resize.Resize(Convert.ToInt32(Convert.ToSingle(resize.Width) * DPIChangeRatio), Convert.ToInt32(Convert.ToSingle(resize.Height) * DPIChangeRatio));
resize.Resample(density, density);
resize.Density = new Density(density, density, DensityUnit.PixelsPerInch);
filename = Guid.NewGuid().ToString() + System.IO.Path.GetExtension(filename);
resize.Write(folder + filename);
}
I also tried flipping the order of Resize and Resample, but it made no difference.