mac os ImageMagick-7.0.8-12 编译及测试

1. 我下载的版本是  ImageMagick-7.0.8-12

2. cd ImageMagick-7.0.8-12

3. ./configure --enable-delegate-build --enable-static --disable-shared

4. make -j4

5. make install

这时会看到安装到了:

/usr/local/include/imageMagick-7/  //这里是头文件

/usr/local/lib/  //这里是库文件  libMagick++-7.Q16HDRI.a

6. xcode 里边

在 Header Search Paths 里增加

/usr/local/include/imageMagick-7

Library Search Paths 增加

/usr/local/lib

link Binary Width Libraries  把动态库拖放进去

libMagick++-7.Q16HDRI.a

  用xcode 建立工程测一下吧
 

#include <Magick++.h> 
#include <iostream> 
using namespace std; 
using namespace Magick; 
int main(int argc,char **argv) 
{ 
  InitializeMagick(*argv);

  // Construct the image object. Seperating image construction from the 
  // the read operation ensures that a failure to read the image file 
  // doesn't render the image object useless. 
  Image image;
  try { 
    // Read a file into image object 
    image.read( "girl.gif" );

    // Crop the image to specified size (width, height, xOffset, yOffset)
    image.crop( Geometry(100,100, 100, 100) );

    // Write the image to a file 
    image.write( "x.gif" ); 
  } 
  catch( Exception &error_ ) 
    { 
      cout << "Caught exception: " << error_.what() << endl; 
      return 1; 
    } 
  return 0; 
}

成功了!!!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值