Improve support for bitmaps

The size of a bitmaps in physical pixels may be different from the size
in 'logical' pixels.