GDI+ SetResolution always results in 96x96



I am using a Bitmap object to modify JPEG images of variing
resolutions.
We'd decided (albeit arbitrarily) to refactor the images at a
resolution of 100x100, and then rescale the images dimensions.

The process seems to work, but the images' resoluion is always 96x96,
not 100x100.
I've found no documentation stating any specific, valid resolutions for

a Bitmap object, so it's vexing me that it it not what I specified it
to be.

Relevant Bits of the Code:

System.Collections.Hashtable imageOutputFormatsTable = new
System.Collections.Hashtable();
imageOutputFormatsTable.Add(System.Drawing.Imaging.ImageFormat.Gif.Guid,Sys­tem.Drawing.Imaging.ImageFormat.Gif);

imageOutputFormatsTable.Add(System.Drawing.Imaging.ImageFormat.Jpeg.Guid,Sy­stem.Drawing.Imaging.ImageFormat.Jpeg);

imageOutputFormatsTable.Add(System.Drawing.Imaging.ImageFormat.Bmp.Guid,Sys­tem.Drawing.Imaging.ImageFormat.Bmp);

imageOutputFormatsTable.Add(System.Drawing.Imaging.ImageFormat.Tiff.Guid,Sy­stem.Drawing.Imaging.ImageFormat.Tiff);

imageOutputFormatsTable.Add(System.Drawing.Imaging.ImageFormat.Png.Guid,Sys­tem.Drawing.Imaging.ImageFormat.Png);


Bitmap outputImage = new Bitmap(origBitmap, newWidth, newHeight);
outputImage.SetResolution(newHRes, newVRes);
ImageFormat outputFormat
=(ImageFormat)imageOutputFormatsTable[origBitmap.RawFormat.Guid];

using (MemoryStream ms = new MemoryStream())
{
outputImage.Save(ms, outputFormat);
outputImage.Dispose();
origBitmap.Dispose();
_image = Image.FromStream(ms, true);
}

.



Relevant Pages

  • GDI+ Bitmap.SetResolution always results in 96x96
    ... I am using a Bitmap object to modify JPEG images of variing ... I've found no documentation stating any specific, valid resolutions for ... ImageFormat outputFormat ...
    (microsoft.public.dotnet.csharp.general)
  • GDI+ using setResolution always results in resolution of 96x96
    ... I am using a Bitmap object to modify JPEG images of variing ... I've found no documentation stating any specific, valid resolutions for ... if (outputCodec!= null) ...
    (microsoft.public.dotnet.framework.drawing)
  • GDI+ using setResolution always results in resolution of 96x96
    ... I am using a Bitmap object to modify JPEG images of variing ... I've found no documentation stating any specific, valid resolutions for ... ImageFormat outputFormat ...
    (microsoft.public.dotnet.general)
  • Re: NVIDIA ForceWare Drivers Ver 56.64 - 3/15/04 (FYI)
    ... many machines have software images placed on them. ... getting it running with a monitor I started updating all of the software. ... won't work at 1024 x 768 - other resolutions were also unusable. ...
    (microsoft.public.windows.mediacenter)
  • PS CS Watermark question
    ... Does anyone know of a method or action that will enable a copyright message ... to be added to a set of images of differing sizes and resolutions as a batch ... when confronted with images of different sizes, orientations or resolutions. ...
    (alt.graphics.photoshop)

Quantcast