簡體   English   中英

iOS Imagemagick在iPhone中應用邊框顏色

[英]iOS Imagemagick to apply border color in iPhone

我已成功將ImageMagick移植到我的iPhone應用程序中,似乎一切正常。 我需要為邊框顏色應用一個濾鏡。 我使用Pixelwand編寫,但是它沒有顯示邊框顏色。 下面是我的代碼。

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

我做錯了什么?

PixelSetColor的第二個參數需要顏色名稱,而不是方法名稱。 例如“洋紅色”,“#FF00FF”或“ rgb(255,0,255)”。 當調用PixelSetColor(color, "PixelGetMagenta");時, MagickBooleanType將返回MagickFalse PixelSetColor(color, "PixelGetMagenta"); ,因為設置名為“ PixeGetMagenta”的顏色將失敗。 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