NSBitmapImageRep *bitmap = [view bitmapImageRepForCachingDisplayInRect:[view visibleRect]]; [view cacheDisplayInRect:[view visibleRect] toBitmapImageRep:bitmap]; NSImage *image = [[NSImage alloc] initWithSize:NSMakeSize(width, height)]; [image addRepresentation:bitmap]; NSBitmapImageRep *bitmap = [NSBitmapImageRep imageRepWithData:data]; NSBitmapImageRep *bitmap = [[[NSBitmapImageRep alloc] initWithCGImage:CGImage];
2018-02-07
NSView NSImage NSData转换
Views: 25791 |
Add Comments