0

I have strange observation on resource file 'Images.resx' contains all images as'.PNG' designed at 96 dpi.

Build action: Embedded Resource

While Debugging at 120 DPI(125 %)

Bitmap myIcon=Images.Icon;

myIcon Horizontal and vertical resolution as 95.9866

Bitmap myIcon = new Bitmap(Images.Icon);

myIcon Horizontal and vertical resolution as 120

Requirement is to merge Images. Based on whether Image is re-initialized or not Image Scales improperly (on dpi >96). How to fix this behavior ?

System: VisualStudio 2017, Winform

JharPaat
  • 321
  • 1
  • 2
  • 12
  • Can't you specify the dpi of the bitmap when you create it? – caesay Sep 29 '17 at 12:38
  • with visual studio No i guess – JharPaat Sep 29 '17 at 12:55
  • 1
    This is by design. Any *new* Bitmap you create records the resolution of the video adapter. Assigning its Horizontal/VerticalResolution properties is the workaround. – Hans Passant Sep 29 '17 at 13:01
  • exactly. because *actual* resolution is a property of a rendering device, not of the picture (that does not mean that the resolution property on the bitmap is useless: https://stackoverflow.com/a/13995552/1132334) – Cee McSharpface Sep 29 '17 at 13:11

0 Answers0