Problem in XCode ( I need help )
I having a program error on the xcode . That I can't solve it . Can someone seriously help me to solve these problem . (Thank In Advance )
These is the problem :
error: 'colorSpace' undeclared (first use in this function)
cvReleaseImage(&small_image);
// Create canvas to show the results
CGImageRef imageRef = imageView.image.CGImage;
//unsigned char *rawData = malloc(imageView.image.size.width*imageView.image.size.height*4);
;
CGContextRef contextRef = CGBitmapContextCreate(NULL, imageView.image.size.width, imageView.image.size.height,
8, imageView.image.size.width * 4,
**colorSpace**, kCGImageAlphaPremultipliedLast|kCG开发者_运维百科BitmapByteOrderDefault);
CGContextDrawImage(contextRef, CGRectMake(0, 0, imageView.image.size.width, imageView.image.size.height), imageRef);
You should declare the 'colorSapce' before calling CGBitmapContextCreate(). e.g CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); if it's still error, modify 'colorSapce' to 'colorSapce'. hope those is used for you .
精彩评论