Problem with resolution

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
magick_user

Problem with resolution

Post 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
Post Reply