Page 1 of 1

Problem with resolution

Posted: 2009-09-05T02:38:30-07:00
by magick_user
Hi all
I'm using magick++.
I'm having a trouble with an image that come from a scanner.
I get a pointer to a HDIB, desume the BITMAPINFOHEADER, then get a pointer to first byte to bitmapbits and call Magick::Image CTOR:

Code: Select all

string h("RGB");
Image* img = new Image(m_bitmapInfoHeader->biWidth,m_bitmapInfoHeader->biHeight,h.c_str(),::MagickCore::CharPixel,(const void*)getBitmapBits());
img->resolutionUnits(PixelsPerInchResolution);
img->density(Geometry(300,300));					
img->flip();
img->magick("BMP");
img->write("c:/magicki_image.bmp");
Where getBitmapBits() give me a DWORD* pointer to bitmap bits.
m_bitmapInfoHeader is a member variable of my class in wich i store a pointer to BITMAPINOHEADER (LPBITMAPINFOHEADER) of the HDIB coming from scanner.
If i set a resolution (from scanner) equals to 200x200 then the image is correct.
Instead i i set another resolution (300x300 for example) the image apper inclined.
Can anyone help about this?
Best regards