c++ - Loading an bmp using ImageMagick -


i'l loading bmp image using image magisk this:

#include <magick++.h>  #include <iostream>  using namespace std;   int main(int argc,char **argv) {    magick::initializemagick(*argv);    magick::image image;   try {       // read file image object      image.read( argv[1] );      cout << "image: " << argv[1] << endl;      cout << image.xresolution() << endl;     cout << image.yresolution() << endl;    }    catch( magick::exception &error_ )      {        cout << "caught exception: " << error_.what() << endl;        return 1;      }    return 0;  } 

the image i'm loading one:

e

its bmp , can loaded here the actual bmp, code compiles fine, resolution information wrong, program outputs:

image: ../sd_nineteen/hsf_0/f0000_14/hsf_0_f0000_14_c0000_14_100_e_65.bmp 0 0 

whats going on, there problem imagemagick or image(i'm guessing there problem image).

martin, appears though image types (eg tiff) support view resolutions, different actual image dimensions. documentation on topic sparse, looking @ source code appears may have image density/dpi info.

regardless of format, actual image dimensions can retrieved using columns() , rows() methods of image class, rather (x/y)resolution() methods.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -