Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

APP support for instrinsic bitmap DPI sizes

APP support for instrinsic bitmap DPI sizes

Refer to C11763984 for background.

APP supports a number of bitmap (raster) graphic file types: JPEG, GIF, BMP, PNG, etc. Most of these graphic file types include a description of the intended physical size of the graphic when output. The relationship between the bitmap rectangle and its intended print-size rectangle is known as DPI (dots per inch). Eg. a JPEG file may be 72 x 72 pixels, and be marked as 72 DPI. In that case it would be printed as a one inch square.

The DPI system does not work correctly in APP 11.0. When APP loads a graphic file, it assigns a DPI based on the *screen* DPI reported by Windows. That is to say, APP ignores the instrinsic DPI sizing information that is included in each graphic file. This is incorrect and furthermore gives inconsistent results across machines - certain machines may report a different DPI which causes graphics to be loaded at inconsistent sizes. This can be easily reproduced by using virtual machines with different window sizes for the virtual consoles.

APP currently supports a workaround in the form of forcing the DPI for various graphic file types via macro:

  • fdpref gif_dpi 96,96
  • fdpref jpg_dpi 96,96
  • fdpref png_dpi 96,96
  • fdpref pcx_dpi 96,96
  • fdpref bmp_dpi 96,96

Our product idea is to supplement the DPI system by having APP detect the DPI correctly in the first place. Eg. when either component of *_dpi is set to zero (0) then the automatically detected DPI is used. If *_dpi is set then the forced DPI is used instead.

Standard methods for representing DPI are:

  • JPEG - EXIF information
  • GIF - not available - DPI is not stored, always assumed to be 72 DPI
  • PNG - pHYs chunk
  • BMP - in BITMAPINFOHEADER structure (biXPelsPerMeter and biYPelsPerMeter)
  • PCX - VertDPI and HorzDPI in PCX header structure

Gareth, vote up your own idea and because you forgot it, that one too: When creating a new product idea, it automatically adds a positive vote for the creator.

Community Manager
Status changed to: Archived


We are archiving your idea as part of a general review. This action is based on the age of your idea and the total number of votes received, as per this announcement.

You can always post a new idea with all the details required in the form.

Thank you for your participation.