-1

I wanna to build a VNC client project in iPad,but when i'm using NPDeskTop demo ,i found that when the picture changes, the screen on iPad maybe show some black lines. I want to know how to fix it. Here is the demo adress: enter link description here

W.F
  • 1
  • 2

1 Answers1

0
int bytesPerPixel = (pixelFormat.bitsPerPixel + 7) >> 3;
CGContextTranslateCTM(ctx, 0, _size.height);
CGContextScaleCTM(ctx, 1.0, -1.0);
// FIXME: rect origin can be negative?
uint32_t *start = (uint32_t *)_buffer.bytes;
int bytesPerRow = _size.width * bytesPerPixel;
CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB();
CGContextRef bmpctx = CGBitmapContextCreate(start, _size.width, _size.height,8 , bytesPerRow, cs, kCGImageAlphaNoneSkipFirst);
CGImageRef image = CGBitmapContextCreateImage(bmpctx);
CGContextDrawImage(ctx, rect, image);
CGImageRelease(image);
CGColorSpaceRelease(cs);
CGContextRelease(bmpctx);

here is my create view func.

W.F
  • 1
  • 2