6
Я использую порт iPhone ImageMagick. Я пытаюсь зацикливать рамки анимированного gif и превращать каждый кадр в UIImage. Я знаю, что могу инициализировать UIImage с NSData, который я могу инициализировать с помощью const void *. Итак, как мне получить буфер и длину изображения?Как получить буфер c из ImageMagick Image
Вот код:
MagickReadImage(wand, filename);
while(MagickHasNextImage(wand)) {
Image *myImage = GetImageFromMagickWand(wand);
//HELP ME PLEASE
const void *myBuff =myImage->blob; //guessing this is the right way to get the buffer?
int myLength = ????? //no idea how to get the length
NSData *myData = [[NSData alloc] initWithBytes:myBuff length:myLength];
UIImage myImage = [[UIImage alloc] initWithData:myData]];
MagickNextImage(wand);
}