• 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: Extract image from text view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Extract image from text view


  • Subject: Re: Extract image from text view
  • From: Douglas Davidson <email@hidden>
  • Date: Wed, 7 Apr 2004 12:08:32 -0700

On Apr 7, 2004, at 11:23 AM, Ian G. Gillespie wrote:

I am hoping someone can give me some direction for being able to extract an image from an NSTextView. In my program a user can place an image in a text view and I would like to extract the image (leaving the text) to use later. I searched the documentation and the archives, but I am still not sure how to do this.

Attachments are stored in the text storage as NSAttachmentCharacter with the attribute NSAttachmentAttributeName, whose value is the NSTextAttachment object. The NSTextAttachment in turn has the contents of the attached file (in its fileWrapper) and also a cell used to represent it visually (its attachmentCell). If the text system recognizes the file as an image file, then it will automatically create an appropriate attachment cell and assign to it an image created from that file. If the text system does not recognize the file format, then it will automatically create an appropriate attachment cell and assign to it a suitable icon image representing the file. What you should do depends on whether you are looking for the image or for the contents of the file.

Douglas Davidson
_______________________________________________
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: 
 >Extract image from text view (From: "Ian G. Gillespie" <email@hidden>)

  • Prev by Date: NSOutlineView : Expand items by default
  • Next by Date: Fixing a leak in an NSFormatter
  • Previous by thread: Extract image from text view
  • Next by thread: NSOutlineView : Expand items by default
  • Index(es):
    • Date
    • Thread