Re: Extract image from text view
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.