On Sat, Aug 23, 2008 at 7:42 PM, Bill Dudney <email@hidden> wrote:
> Thanks David,
> So if I understand you correctly I could so something like this.
> NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle]
> pathForResource:@"image" ofType:@"png"]];
> CGDataProviderRef maskData = CGDataProviderCreateWithURL((CFURLRef)url);
>
> CGImageRef image1 = CGImageCreateWithPNGDataProvider(maskData, NULL, NO,
> kCGRenderingIntentDefault);
>
> size_t width = CGImageGetWidth(image1);
> size_t height = CGImageGetHeight(image1);
> size_t bitsPerComponent = CGImageGetBitsPerComponent(image1);
> size_t bitsPerPixel = CGImageGetBitsPerPixel(image1);
> size_t bytesPerRow = CGImageGetBytesPerRow(image1);
> CGColorSpaceRef colorSpace = CGImageGetColorSpace(image1);
> CGBitmapInfo info = CGImageGetBitmapInfo(image1);
> CGFloat *decode = NULL;
> BOOL shouldInteroplate = NO;
> CGColorRenderingIntent intent = CGImageGetRenderingIntent(image1);
> CGDataProviderRef pngProvider = CGImageGetDataProvider(image1);
> CGImageRef image2 = CGImageCreate(width, height, bitsPerComponent,
> bitsPerPixel, bytesPerRow, colorSpace, info, pngProvider, decode,
> shouldInteroplate, intent);
Why are you doing this? You already have an CGImage instance because
of what you got back from CGImageCreateWithPNGDataProvider. Why do you
want to create another image instance in rather round about way?
Again what are you really trying to achieve? Do you want access to the
pixels? Do you want to just draw the image? etc.
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden