objective c - Image of NSView with background -


I'm trying to get an image of a scene, so I'll call it NSImageView .

I am using the NSView s bitmapImageRepForCachingDisplayInRect: method.
However, this method only returns the contents of the scene, without the window background.

How can I get an image of the whole scene, because it looks on the screen with background-color etc?


Current code
  - (NSImage *) imageOfView: (NSView *) View {NSiBITMAPIMJARP * Representative = [View BitMapExpressionFirstingDisplay: see.bound]; [See cache displayline: view: frame to bitmap image: representative]; Return [[NSImage alloc] initWithCGImage: [Representative CGImage] Size: view.bounds.size]; }    

  / * This statement from CGDirectDisplayID Get index for display selected from array * / NSInteger displayIndex = [menu item tag]; / * Create a snapshot image of the current display. * / CGImageRef image = CGDisplayCreateImage (displays [displaysIndex]);    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -