I have been trying to write an image on a layer using Quartz but all I see is totally empty images... this is the code
CGContextRef context = UIGraphicsGetCurrentContext();
CGRect backRect = CGRectMake (0, 0, image.size.width, image.size.height);
CGLayerRef backLayer = CGLayerCreateWithContext (context, image.size, NULL);
CGContextRef backContext = CGLayerGetContext (backLayer);
CGContextDrawImage(backContext, backRect, image.CGImage);
can you guys please tell me what is wrong with this code?
image is a UIImage taken with the camera.
Yes, the image is there. If I replace the above code with
UIGraphicsBeginImageContext(image.size);
[image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)];
I see the image. But I have to have it in a layer, as it is a sprite.