MagickWand是一个PHP的模块,用来访问ImageMagick的图像处理库。下面是一个使用MagicWand的代码片段:
$magick_wand=NewMagickWand();MagickReadImage($magick_wand,'rose.jpg');$drawing_wand=NewDrawingWand();DrawSetFont($drawing_wand,"/usr/share/fonts/bitstream-vera/Vera.ttf");DrawSetFontSize($drawing_wand,20);DrawSetGravity($drawing_wand,MW_CenterGravity);$pixel_wand=NewPixelWand();PixelSetColor($pixel_wand,"white");DrawSetFillColor($drawing_wand,$pixel_wand);if(MagickAnnotateImage($magick_wand,$drawing_wand,0,0,0,"Rose")!=0){MagickEchoImageBlob($magick_wand);}else{echoMagickGetExceptionString($magick_wand);}?>安装方法:
下载php_magickwand_q16_st.dllfor5.2.x将其放在PHP的扩展目录在php.ini文件总增加extension=php_magickwand_q16_st.dll重新启动apache
评论