• 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
Re: Saving as JPEG
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving as JPEG


  • Subject: Re: Saving as JPEG
  • From: Marcel Weiher <email@hidden>
  • Date: Sat, 18 Jan 2003 10:58:22 +0100

On Friday, January 17, 2003, at 10:17 Uhr, Marco Binder wrote:

NSCachedImageRep doesnt understand the representationOfType message (as the docs will tell you). Thats why you called this function on the NSBitmapImageRep class! So you have to make your image into an NSBitmapImageRep obviously.

1) get the TIFF data of the image and use it to initialize a NSBitmapImageRep

2) call representationOfType: on this NSBitmapImageRep and pass NSJPEGFileType (and optionally a properties dictionary to set the compression factor)

Hmm, I see this a lot, but it doesn't really make sense: you first serialize the internal bitmap into a file format (which will go through an NSBitmapImageRep somewhere along the way!), then you initialize a new NSBitmapImageRep from the serialized representation and then you serialize that into another representation.

Better:

while still focused on the NSImage, use [[NSBitmapImageRep alloc] initWithFocusedViewRect: ... ];. That gets you the NSBitmapImageRep without any intermediate steps, and you can party with that.

If you messed around with the CTM, you may want to unlockFocus and re-lockFocusm, because -initWithFocusedViewRect: will take the CTM into account.

Marcel


--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
_______________________________________________
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.

References: 
 >Re: Saving as JPEG (From: Marco Binder <email@hidden>)

  • Prev by Date: Re: Re(2): NSTextField selectText behaviour (Currency Converter Tut)
  • Next by Date: contextual menu in NSTableView cell - NEW
  • Previous by thread: Re: Saving as JPEG
  • Next by thread: mail.app help
  • Index(es):
    • Date
    • Thread