• 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
NSImage & NSImageRep
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSImage & NSImageRep


  • Subject: NSImage & NSImageRep
  • From: Jeff LaMarche <email@hidden>
  • Date: Sat, 4 May 2002 10:35:32 -0700

Okay, I'm banging my head against the wall. I want to create an NSImage of a particular size (i.e. 1" x 3") that is resolution independent. It seems that the best way to do this would be to add an NSEPSImageRep before doing my drawing, but all the init methods for NSImageRep and its subclasses seem to require existing data of some form. How do I add an EPS representation to an image, or otherwise make an NSImage resolution independent so that it will scale up. It seems like no matter what I do, the NSImage contains only the bitmap, 72dpi representation of what I draw - I have tried setting setScalesWhenResized:YES and setDataRetained:YES before drawing, but scaling the image results in interpolated data.

I know that I can accomplish pretty much the same thing be creating a subclass of NSView and putting the drawing code there, but that seems kludgey since I'm not primarily looking to use this image in a view.

I suspect I'm missing something obvious. The existence of multiple representations seems to indicate that there must be a way to do this directly with the NSImage and NSImageRep classes. I searched the mailing lists and learned a few helpful things about image representations, but did not find anything right on target.

If someone could just point me in the right direction on this, I would greatly appreciate it. I don't need anything in-depth, just a nudge =)

As always, thanks in advance.

Jeff LaMarche
email@hidden
PGP Public Key Available Upon Request
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Using a subclassed NSMatrix with NSBrowser
  • Next by Date: Re: Cocoa --> GnuStep
  • Previous by thread: Re: Using a subclassed NSMatrix with NSBrowser
  • Next by thread: Using notifications vs. listener lists
  • Index(es):
    • Date
    • Thread