Note that there are some explanatory texts on larger screens.

plurals
  1. POScreenshot code working perfectly in Simulator but not in iOS Device
    primarykey
    data
    text
    <p>This is my code for screenshot to save in library or do email. The problem is, it is working perfectly in Simulator but when i run this code in Device whatever on screen it only gets white image. I have tried with iOS 5 and iOS 6 both but no luck What should be the reason Where i am wrong</p> <pre><code> NSInteger myDataLength = 320 * 430 * 4; GLubyte *buffer1 = (GLubyte *) malloc(myDataLength); GLubyte *buffer2 = (GLubyte *) malloc(myDataLength); //Read image memory form OpenGL glReadPixels(0, 50, 320, 430, GL_RGBA, GL_UNSIGNED_BYTE, buffer1); //Invert result image buffer into secondary buffer for(int y = 0; y &lt; 430; y++) { for(int x = 0; x &lt; 320 * 4; x++) { buffer2[(429 - y) * 320 * 4 + x] = buffer1[y * 4 * 320 + x]; } } //Create bitmap context CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGContextRef destContext = CGBitmapContextCreate(buffer2, 320, 430, 8, 320 * 4, colorSpace, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); //Get image from context CGImageRef resultContext = CGBitmapContextCreateImage(destContext); UIImage *resultImg = [UIImage imageWithCGImage: resultContext]; CGImageRelease(resultContext); //Send to mail or Save to PhotoLibrary if (sendMail) { [self emailImage: resultImg]; } else { UIImageWriteToSavedPhotosAlbum(resultImg, nil, nil, nil); } //Release allocated memory // [resultImg release]; free(buffer2); free(buffer1); CGContextRelease(destContext); CGColorSpaceRelease(colorSpace); </code></pre> <p>is there any class i am using which is supported by Simulator and not the device If it so then which one because as far as i search i found nothing like that.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload