Not even a portion of a window?
Not even a portion of a window?
- Subject: Not even a portion of a window?
- From: Lorenzo <email@hidden>
- Date: Fri, 15 Jul 2005 19:20:30 +0200
H,
why can't I get an image of my window?
I get an empty image all the time. What did I miss?
NSRect imageRect = [[aWindow contentView] bounds];
NSSize imageSize = imageRect.size;
NSData *imageData = nil;
NSImage *image = [[NSImage alloc] initWithSize:imageSize];
[image lockFocus];
[[aWindow contentView] drawRect:imageRect];
imageData = [image TIFFRepresentation];
[image unlockFocus];
[imageData writeToFile:@"/a_image_%d.tiff" atomically:YES];
[image release];
Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden