Blog: Tech Talk

agsdix-fas fa-home

Blog: Home

agsdix-fas fa-pen-fancy

Blog: CEO's Corner

agsdix-fas fa-code

Blog: Tech Talk

Blog: Product Releases

agsdix-fas fa-chalkboard-teacher

Blog: Viewing

Blog: Conversion

arrow left circle icon Blog: Tech Talk

Changing TIFF Horizontal and Vertical Resolution

by | Apr 24, 2012

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