• 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: Writing an image from a text view to file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing an image from a text view to file


  • Subject: Re: Writing an image from a text view to file
  • From: Frank Midgley <email@hidden>
  • Date: Wed, 10 Mar 2004 14:47:16 -0600

On Mar 10, 2004, at 9:52AM, Jeremy Dronfield wrote:

I have a text view with some text and an image. For my own perverse reasons, I want to save the text into one file (that's okay, I can handle that) and the image into a completely separate file, rather than save the whole lot to rtfd.

I've retrieved the image as an NSTextAttachment. When using rtfd as the source for the view I can copy the image to file from the attachment's file inside the rtfd package. But when the view's contents come from encrypted data (as is more usual in my application) rather than a file package, [attachment fileWrapper] returns NULL. So my question is, how can I get the image out of the attachment and into a file? I know this is a slightly unusual question, but I'd be grateful for any leads.

Try getting the NSImage with [[[attachment attachmentCell] image] and then writing that to disk. There are ample examples of saving an NSImage in the archives.

-Frank

------------------------------------
Frank M. Midgley
email@hidden
http://homepage.mac.com/knarf/
_______________________________________________
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.


  • Follow-Ups:
    • Re: Writing an image from a text view to file
      • From: Jeremy Dronfield <email@hidden>
References: 
 >Writing an image from a text view to file (From: Jeremy Dronfield <email@hidden>)

  • Prev by Date: Re: Wisdom of overriding isEqual:
  • Next by Date: Re: [SOLVED...but] Re: Storing NaN in NSMutableArray ?
  • Previous by thread: Writing an image from a text view to file
  • Next by thread: Re: Writing an image from a text view to file
  • Index(es):
    • Date
    • Thread