Franchi_S5#32570
I´m working with TIFF and JPEG images. I have two options, change resolution or not.
The problem is that when I chage the ouput image resolution the size of the image is the same. The ResolutionModifier and ImageGenerator methods change the resolution but does not change the dimensions of the image.
Could you help me? If my input image after cropping is 21x15 cm. I should get the same size in 300 or 150 dpi.
Thanks in advance.
The problem is that when I chage the ouput image resolution the size of the image is the same. The ResolutionModifier and ImageGenerator methods change the resolution but does not change the dimensions of the image.
using (var reader = TiffReader.Create(ficheroIN))
using (var crop = new Crop(rectangulo))
using (var writer = new TiffWriter(ficheroOUT))
{
var exif = new ExifDictionary();
var iptc = new IptcDictionary();
if (procesar_exif == false)
{
exif = reader.Exif;
writer.Exif = exif;
}
else
{
if (checkBoxEXIF.Enabled)
writer.Exif = InsertarEXIF(exif);
if (checkBoxIPTC.Checked)
writer.Iptc = InsertarIPTC(iptc);
}
if (border_size != 0)
{
using (var borderColor = RgbColor.Black)
using (var generator = new ImageGenerator(crop.Rectangle.Width + border_size * 2, crop.Rectangle.Height + border_size * 2, reader.PixelFormat, borderColor))
using (var blender = new Blender())
{
blender.TopImage = reader.Frames[0] + crop;
blender.X = border_size;
blender.Y = border_size;
generator.DpiX = reader.DpiX;
generator.DpiY = reader.DpiY;
Pipeline.Run(generator + blender + writer);
bitmap.Dispose();
}
}
else
{
Pipeline.Run(reader + crop + writer);
}
}Could you help me? If my input image after cropping is 21x15 cm. I should get the same size in 300 or 150 dpi.
Thanks in advance.