How to get the Pixel Data of UIimage after scaling and moving,I wan to get the CGImage Pixel Data and then get the UIImage from CGImage Pixel Data.How can we do this?.
You can get the rawdata by calling
CFDataRef rawData = CGDataProviderCopyData(CGImageGetDataProvider(aCGImageRef));
You can step through pixels like this:
UInt8 * buf = (UInt8 *) CFDataGetBytePtr(rawData);
CFIndex length = CFDataGetLength(rawData);
for(unsigned long i=0; i<length; i+=4)
{
int r = buf[i];
int g = buf[i+1];
int b = buf[i+2];
}
CFRelease(rawData);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With