0

以下のコードを使用して、rgba forful ビューを埋めています。しかし、私は半分(1/2)の幅しか得ていません。誰でも私のコードに問題があることを教えてください。

             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の代わりにwidthとのheight * [UIDevice currentDevice].scale代わりに: を使用してみてくださいheight

デバイスには Retina 画面があり、320 ピクセルのビューは実際には 640 ピクセルのビューであることに注意してください。(スケール = 2)

于 2012-09-25T10:05:02.840 に答える