• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Snapshot of NSOpenGLView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Snapshot of NSOpenGLView
      • From: Pierre-Olivier Latour <email@hidden>
  • Prev by Date: [ANN]XLOCCount ( source code metric tool )
  • Next by Date: sourceforge, nibs and other wrappers
  • Previous by thread: [ANN]XLOCCount ( source code metric tool )
  • Next by thread: Re: Snapshot of NSOpenGLView
  • Index(es):
    • Date
    • Thread