• 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
Switching off antialiasing...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Switching off antialiasing...


  • Subject: Switching off antialiasing...
  • From: Stefan Jung <email@hidden>
  • Date: Thu, 19 Jul 2001 10:30:48 +0200

...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


  • Follow-Ups:
    • Re: Switching off antialiasing...
      • From: Marcel Weiher <email@hidden>
  • Prev by Date: Re: Creating PDF from a view with custom bounds
  • Next by Date: Re: Switching off antialiasing...
  • Previous by thread: Re: [q] scriptSuite conflict problems (code included)
  • Next by thread: Re: Switching off antialiasing...
  • Index(es):
    • Date
    • Thread