| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
...is very easy for the on screen display. But what is the trick to
do this with an image?
I tried a lot with lockig focus and so on...no chance. The TIFF I
want to save is always antialiased, regardless it is set or not.
My code:
-(void)saveAsTIFF:sender
{
NSImage *specImage;
NSSavePanel *sp;
int result;
NSGraphicsContext *graphicsContext;
specImage = [[NSImage alloc] initWithSize:[self bounds].size];
[specImage lockFocus];
graphicsContext = [NSGraphicsContext currentContext];
[graphicsContext setShouldAntialias:NO];
[specImage initWithData:[self dataWithPDFInsideRect:[self bounds]]];
[specImage unlockFocus];
sp = [NSSavePanel savePanel];
[sp setRequiredFileType:@"TIFF"];
result = [sp runModalForDirectory:NSHomeDirectory() file:[[self
window] title]];
if (result == NSOKButton) {
if (![[specImage TIFFRepresentation] writeToFile:[sp
filename] atomically:YES])
| References: | |
| >Switching off antialiasing... (From: Stefan Jung <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.