简体   繁体   English

iOS Imagemagick在iPhone中应用边框颜色

[英]iOS Imagemagick to apply border color in iPhone

I have successfully ported ImageMagick in my iPhone Application, everything seems to be working. 我已成功将ImageMagick移植到我的iPhone应用程序中,似乎一切正常。 I need to apply one filter for border color. 我需要为边框颜色应用一个滤镜。 I have written using Pixelwand, however its not been showing border color. 我使用Pixelwand编写,但是它没有显示边框颜色。 Below is my code. 下面是我的代码。

PixelWand *color = NewPixelWand();
PixelSetColor(color, "PixelGetMagenta");
status = MagickSetImageBorderColor(magick_wand, color);

What I am doing wrong? 我做错了什么?

PixelSetColor's second parameter is expecting color name, not a method name. PixelSetColor的第二个参数需要颜色名称,而不是方法名称。 Example "magenta", "#FF00FF", or "rgb(255,0,255)". 例如“洋红色”,“#FF00FF”或“ rgb(255,0,255)”。 The MagickBooleanType would return MagickFalse when calling PixelSetColor(color, "PixelGetMagenta"); 当调用PixelSetColor(color, "PixelGetMagenta");时, MagickBooleanType将返回MagickFalse PixelSetColor(color, "PixelGetMagenta"); , as setting a color named "PixeGetMagenta" would fail. ,因为设置名为“ PixeGetMagenta”的颜色将失败。 PixelGetMagenta is usally used with PixelGetMagentaQuantum when working directly with color packets. PixelGetMagenta是usally与使用PixelGetMagentaQuantum直接与颜色分组工作时。

MagickBooleanType status;
PixelWand *color = NewPixelWand();
status = PixelSetColor(color, "magenta");
// Error handle if status == MagickFalse
status = MagickSetImageBorderColor(magick_wand, color);
// Error handle if status == MagickFalse
status = MagickBorderImage(wand,color,10,10);
// Error handle if status == MagickFalse

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM