Tag: core graphics

从UIColor中提取rgb

看到这个问题之前,但我的例子似乎并没有工作。 const CGFloat *toCol = CGColorGetComponents([[UIColor greenColor] CGColor]); 用GDB查看数组是空的。 任何提示?

通过iOS创build和导出animationgif?

我在iOS应用程序中有一系列用户自定义的图像,这些图像是以简单的,逐帧的翻页样式进行animation的。 我的问题是这样的:有没有办法让用户导出他们的animation作为animationgif? 理想情况下,我想让他们通过电子邮件,社交分享(T / FB)或(最糟糕的情况下)保存一个animation的gif到他们的文档文件夹通过iTunes检索。 我知道如何将.png保存到照片库中,并且find了将animation录制为QT文件的方法( http://www.cimgf.com/2009/02/03/record-your-core-animation – animation/ ),但我还没有find一个方法,只是踢出一个普通的老animationgif。 我在核心animation或其他地方丢失了什么? 有没有人可以推荐的方法,框架或资源? 对不起,如果这个问题太笼统 – 努力寻找出发点。 任何帮助赞赏。

问题设置图像的exif数据

我在iOS 4.1中使用了新的ImageIO框架。 我使用以下方法成功检索了exif元数据: CFDictionaryRef metadataDict = CMGetAttachment(sampleBuffer, kCGImagePropertyExifDictionary , NULL); 读出来,看起来有效。 保存图像的作品,但从来没有任何exif数据的图像。 CGImageDestinationRef myImageDest = CGImageDestinationCreateWithURL((CFURLRef) docurl, kUTTypeJPEG, 1, NULL); // Add the image to the destination using previously saved options. CGImageDestinationAddImage(myImageDest, iref, NULL); //add back exif NSDictionary *props = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithFloat:.1], kCGImageDestinationLossyCompressionQuality, metadataDict, kCGImagePropertyExifDictionary, //the exif metadata nil]; //kCGImagePropertyExifAuxDictionary CGImageDestinationSetProperties(myImageDest, (CFDictionaryRef) props); […]