Resizing an image in an NSTextView
Resizing an image in an NSTextView
- Subject: Resizing an image in an NSTextView
- From: Jeff Holland <email@hidden>
- Date: Mon, 20 Aug 2001 00:17:46 -0500
Hello everyone,
I have some code which resizes an image in an NSTextView, and it works
well enough. The problem is that if I drag and drop the image to a new
location within the document, or if I save and reopen the document, the
image will revert to its original size. I realize this is because it's
really an NSTextAttachment which points to a file on disk. Can anyone
recommend a good strategy (or even a bad strategy) for making my resized
image persistent? It seems inefficient to write the resized image out to
disk every time a 'Grow' or 'Shrink' button is pressed. Also, if an
image is dragged from the Finder onto my NSTextView, where does it
really "live" until I save the document? (Obviously, I wouldn't want my
app to be resizing the original image file.)
Thanks in advance for any suggestions.
-jeff