Changing TIFF Horizontal and Vertical Resolution

Snowbound Software’s RasterMaster for the .NET Platform includes the ability to change the horizontal or vertical resolution for file formats such as TIFF files. For example, if you have a file that is 240 x 120 and you want to change resolution to 240 x 240, you can use the C# code sample below to change the resolution.

status = simage.CIMG_decompress_bitmap_page(fileName,page);

sdibHeader = new CDIB_HEADER();
status = simage.CIMG_bitmap_info(sdibHeader);
// Or use status = simage.CIMGLOW_get_bitmap_header(sdibHeader);

//set XDPI
//sdibHeader.biXPelsPerMeter = 200;
//Set YDPI
sdibHeader.biYPelsPerMeter = 2*sdibHeader.biYPelsPerMeter;

status = simage.CIMGLOW_set_bitmap_header(sdibHeader);

status = simage.CIMG_resize_bitmap(240, 240);

Category:

Online Demo