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);
             );
4

1 回答 1

0

尝试使用:width * [UIDevice currentDevice].scale代替widthheight * [UIDevice currentDevice].scale代替height

请记住,您的设备可以有 Retina 屏幕,而您的 320 像素视图实际上是 640 像素视图。(规模 = 2)

于 2012-09-25T10:05:02.840 回答