Snapshot of NSOpenGLView
Snapshot of NSOpenGLView
- Subject: Snapshot of NSOpenGLView
- From: Drew McCormack <email@hidden>
- Date: Mon, 2 Sep 2002 02:56:23 -0700 (PDT)
I am trying to get a TIFF image of an NSOpenGLView, and save it to file. Here is my code stripped down a bit:
NSBitmapImageRep *bitmap;
[openGLView lockFocus];
bitmap = [[[NSBitmapImageRep alloc] initWithFocusedViewRect:[openGLView bounds]] autorelease];
[openGLView unlockFocus];
NSSavePanel *panel = [NSSavePanel savePanel];
[panel setRequiredFileType:@"tiff"];
if ( NSOKButton == [panel runModalForDirectory:NSHomeDirectory() file:nil] ) {
NSData *tiffData = [bitmap TIFFRepresentation];
[tiffData writeToFile:[panel filename] atomically:YES];
}
This produces a blank white tiff file. What am I doing wrong?
Drew McCormack
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.