Re: Bitmap class problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Nick (pacemkr_at_optonline.net)
Date: 07/05/04


Date: Mon, 05 Jul 2004 04:38:03 GMT

TCR wrote:
> Hi,
> I'm using the Image.FromImage() function to load a jpg file into a bitmap
> class and then convert it to a lower resolution. The problem I'm having is
> that if I check the resolution of the image using either of the properties
> (Horizontal or Vertical), it reports it as 72 dpi when in fact they are 300
> dpi. Is this a known bug? For example I have an image that is 1200 X 1600
> pixels at 300 dpi but when I load it into the bitmap class it reports the
> width and height correctly in pixels but not the resolution.
> Any help would be greatly appreciated,
> Troy Reagan
>
>

Try importing the image from file like this. See if that makes any
difference.

Bitmap myBitmap = new Bitmap("filename");



Relevant Pages

  • Bitmap class problem
    ... I'm using the Image.FromImagefunction to load a jpg file into a bitmap ... class and then convert it to a lower resolution. ... it reports it as 72 dpi when in fact they are 300 ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: UPLOAD IMAGE from Asp.net
    ... Use the FromFile method to load the bitmap and use its Height/Width to get ... the size (you can also have the resolution and the bit depth). ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: VB3 is making my head spin!
    ... > and displaying it pixel by pixel] tell me how. ... compressed bitmap from an original 24 but full colour bitmap that is held on disk as a standard ... It shows you how to load a full colour 24bit .bmp file from disk and count ... Dim z As Long, t1 As Long, t2 As Long ...
    (comp.lang.basic.visual.misc)
  • Re: Loading image byte array
    ... Thanks Frank, I actually got it working myself before I saw your code. ... load the my image like Michael Phillips suggested. ... at that point Then create a Graphics using a fast-access second bitmap (we ... by pixel over to the byte array. ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: ImageList: Is this possible?
    ... Now I want to load ... There's an API fiunction that lets you create a bitmap in memory: ... lpInfoHeader As BITMAPINFOHEADER, ByVal dwUsage As Long, lpInitBits As ...
    (microsoft.public.vb.general.discussion)