Darkroom
Jul 2, 2008, 07:51 AM
this isn't working right now, but i think i'm on the right path... maybe i just have something small missing from the method?
it's an IBAction method. user activates the actions, the NSView is suppose to convert into a TIFF and save itself to the desktop.
-(IBAction)saveViewToDesktop:(id)sender
{
[self lockFocus];
NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:[self bounds]];
[self unlockFocus];
NSData *data = [rep TIFFRepresentation];
NSString *filePath = @"/Users/myrealname/Desktop/";
[data writeToFile:filePath atomically:YES];
}
it's an IBAction method. user activates the actions, the NSView is suppose to convert into a TIFF and save itself to the desktop.
-(IBAction)saveViewToDesktop:(id)sender
{
[self lockFocus];
NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:[self bounds]];
[self unlockFocus];
NSData *data = [rep TIFFRepresentation];
NSString *filePath = @"/Users/myrealname/Desktop/";
[data writeToFile:filePath atomically:YES];
}
