Reference:
Http://www.imagemagick.org/script/install-source.php#windows
http://blog.163.com/anteaus_20/blog/static/24422224200811924810941/
"Build Process"
1) According to ImageMagick Installation Guide under Windows, download the source package here (take 6.8.9 as an example), unzip, into the extracted directory.
2) in Visual Studio (take VS2008 as an example), open the Configure.sln in Imagemagick-6.8.9/visualmagick/configure, and if prompted to convert the format, go. Then Build->build solution.
3) Configure.exe will appear in Imagemagick-6.8.9\visualmagick\configure, double-click to run
4) Click "Next"
5) Select "Static multi-threaded DLL Runtime" and then the next step until the end. The VisualStaticMTDLL.sln is generated under Imagemagick-6.8.9\visualmagick.
6) Open VisualStaticMTDLL.sln in Visual Studio and compile the entire solution.
"One compilation Error"
During the compilation, Core_pango the following compilation error:
Solution
All the "newline in constant" error, delete the string of the error line, populate an ASCII string, such as "...", and recompile.
"Build Result"
Eventually, a lot of exe files, LIB, DLL files will be generated under Imagemagick-6.8.9\visualmagick\bin. These include the convert.exeto be used below.
Generate a bunch of. lib files under Imagemagick-6.8.9\visualmagick\lib.
Test
Follow the example in [ImageMagick Learning] Fred's ImageMagick Scripts to C + + Unified solution post for raw_text.jpg to eliminate background noise.
Copy both Convert.exe and raw_text.jpg to a directory, such as d:/ Under this directory, go to the command line and execute the following command
[Plain]View PlainCopy
- Convert (Raw_text.jpg-colorspace gray-type grayscale-contrast-stretch 0) (-clone 0-colorspace Gray-negate-lat 25x 25+10%-contrast-stretch 0)-compose copy_opacity-composite-fill "White"-opaque none +matte-deskew 40%-sharpen 0x1 o Ut.jpg
Will get the following out.jpg
Using Visual Studio to build ImageMagick under Windows