Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Switching off antialiasing...



...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])
NSBeep();
}
}

Again, the view on screen is aliased, the saved TIFF is
antialiased. Any idea to circumvent this?

Stefan Jung




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.