0

i am using below code for fill rgba forful view. but i am getting half(1/2) width only. anybody please inform me anything wrong with my code.

             CGContextRef bitmap = CGBitmapContextCreate(
             rgba,
             width,     // width = 320
             height,        // 460
             8               //CGImageGetBitsPerComponent(imageRef),    
             4 * width, // rowbytes
             colorSpace,
             kCGImageAlphaNoneSkipLast);
             );
sreenivas
  • 399
  • 2
  • 5
  • 20

1 Answers1

0

Try using:width * [UIDevice currentDevice].scale instead of width and height * [UIDevice currentDevice].scale instead of height.

Remember that your device can have a Retina screen and your 320px view is in fact a 640px view. (scale = 2)

fbernardo
  • 10,016
  • 3
  • 33
  • 46
  • How about scaling your Core Graphics context with CGContextScaleCTM? Have you tested this in retina and non-retina? – fbernardo Sep 25 '12 at 11:53