0

I'm trying to take a screenshot with CGDisplayCreateImage and then send them to Magick++ to do some basic image manipulation. Right now I'm saving the images to files, but I want to be able to store them in a Magick++ blob.

I've already seen this question: How to convert from CGImageRef to GraphicsMagick Blob type?, but I'm using C++ and I can't find an alternative to NSData.

4

1 回答 1

0

您应该能够在不NSData使用std::vector<unsigned char> MyCopiedData. 那么这将只是一个简单的过程Magick::Blob(MyCopiedData.data(),MyCopiedData.size())

但是NSData&CFDataRef是可以互换的,并被认为是“免费桥”。包含 Foundation 库并利用类的好处并不需要太多努力NSData

于 2014-03-05T19:16:36.987 回答