Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone中的ImageMagick:如何在Iphone中将图像对象转换为UIImage_Iphone_Imagemagick - Fatal编程技术网

Iphone中的ImageMagick:如何在Iphone中将图像对象转换为UIImage

Iphone中的ImageMagick:如何在Iphone中将图像对象转换为UIImage,iphone,imagemagick,Iphone,Imagemagick,我试图在Iphone中使用imageMagick创建图像失真。 以下是我的代码: Image *img = GetImageFromMagickWand(magick_wand); const double ctrlPts[8] = {150,150,50,50,10,20,90,10}; const size_t q = 4; ExceptionInfo *d = AcquireExceptionInfo() ; const RectangleInfo r = {10,10,5,4}; siz

我试图在Iphone中使用imageMagick创建图像失真。 以下是我的代码:

Image *img = GetImageFromMagickWand(magick_wand);
const double ctrlPts[8] = {150,150,50,50,10,20,90,10};
const size_t q = 4;
ExceptionInfo *d = AcquireExceptionInfo() ;
const RectangleInfo r = {10,10,5,4};
size_t my_size;
Image *distortedImage = DistortImage(img, AffineDistortion, q, ctrlPts, MagickTrue, d);
现在我在这里陷入了困境。如何将扭曲的图像对象转换为UIImage对象,以便我可以使用该图像

NSData * data = [[NSData alloc] initWithBytes:distortedImage length:my_size];
free(distortedImage);
UIImage * image = [[UIImage alloc] initWithData:data];
如果您不知道尺寸,请尝试以下方法:

NSData *data = UIImagePNGRepresentation(initWithBytes:distortedImage);
free(distortedImage);
UIImage * image = [[UIImage alloc] initWithData:data];
如果您不知道尺寸,请尝试以下方法:

NSData *data = UIImagePNGRepresentation(initWithBytes:distortedImage);
free(distortedImage);
UIImage * image = [[UIImage alloc] initWithData:data];

试试这个:@Ade:谢谢你的回复。但我的困惑是,我的形象扭曲了形象,而不是在魔杖里。那么如何获取新图像
扭曲图像
??请尝试以下操作:@Ade:谢谢回复。但我的困惑是,我的形象扭曲了形象,而不是在魔杖里。因此,如何获取新图像
扭曲图像
??在不知道大小的情况下获取NSData时,在此处使用未声明的标识符initWithBytes。在不知道大小的情况下获取NSData时,在此处使用未声明的标识符initWithBytes。