Thank you for your follow up. Now, things started getting more clear to me. I have done more testing and I realized that there is no issue with Density property. Density property works fine and it sets the resolution to 300 dpi as I require. I can check this by right clicking on the output image and then click on properties. All information about the image are listed there. However, what confused me is that appending an image (image) to a newly created image (footer_image) will set the resolution of the output image (output) to 1 dpi. I can also fix this by setting the resolution of the new image (footer_image) to 300. This will ensure that the output image has the correct resolution. Now, only one thing is remaining. Though the resolution of the output is now correct, the output image size dropped from 10.4 MB to 3.70 MB. If no image appending is involved (only resolution is changed), the image size drops by only 0.2 MB. But once I append the image to the footer image, the size drops drastically.
Note that I am using .JPG format for both input and output.
Regards,
Menhal
MagickImage image = new MagickImage("#PATH#");
MagickImageCollection images = new MagickImageCollection();
MagickImage footer_image = new MagickImage();
footer_image.BackgroundColor = Color.Black;
footer_image.FillColor = new MagickColor(Color.White);
footer_image.FontPointsize = 100;
footer_image.TextDirection = TextDirection.RightToLeft;
footer_image.Font = "Arial";
footer_image.Read("pango:<span foreground=\"white\">" + "مرحبا" + "</span>");
footer_image.Extent(image.Width, 300, Gravity.East);
footer_image.Density = new PointD(300);
images.Add(image);
images.Add(footer_image);
output = images.AppendVertically();
output.Write(physicalNewImagePath);
Note that I am using .JPG format for both input and output.
Regards,
Menhal
MagickImage image = new MagickImage("#PATH#");
MagickImageCollection images = new MagickImageCollection();
MagickImage footer_image = new MagickImage();
footer_image.BackgroundColor = Color.Black;
footer_image.FillColor = new MagickColor(Color.White);
footer_image.FontPointsize = 100;
footer_image.TextDirection = TextDirection.RightToLeft;
footer_image.Font = "Arial";
footer_image.Read("pango:<span foreground=\"white\">" + "مرحبا" + "</span>");
footer_image.Extent(image.Width, 300, Gravity.East);
footer_image.Density = new PointD(300);
images.Add(image);
images.Add(footer_image);
output = images.AppendVertically();
output.Write(physicalNewImagePath);