Re: Help with pixellated NSTIFFRepresentation issues much appreciated
Re: Help with pixellated NSTIFFRepresentation issues much appreciated
- Subject: Re: Help with pixellated NSTIFFRepresentation issues much appreciated
- From: Robert Clair <email@hidden>
- Date: Wed, 13 Oct 2004 10:34:35 -0400
I could then drag the image back
from the text view into the image view and zoom it
with no loss of quality. However, it would then only
zoom up so far before the image snapped back to the
size it was when originally dropped. So ultimately,
this method doesn't help much either...
Maybe this has something to do with the NSImageView ??
I avoid all this and any possible problems with NSImage doing
strange things to me by doing the transformations myself.
I have a display list app and the images are put in a subclass
of a "display list graphic". The subclass includes an NSAffineTransform
as well as the image. When the image is loaded I make sure
that the image size is the same as the pixel size.
If the intended size was different from the pixel size, this is
reflected in the initial state of the transform. Any further
translation, rotation, scaling or shearing is done by modifying
the matrix. When it comes time to draw the object saves the gc,
concats the matrix, draws and then restores the gc.
I itself just as you can in Word or Nisus Writer Express
(click and drag on the image to resize), but had no
idea of how to go about this.
You may be asking a bit too much of a generic textview. Perhaps
someone knows of an easier way to do it, but I think you'd have
to subclass the text view, add some machinery to keep track of your
images, draw them when appropriate, mouse handling to hit test
for a mouse down on the image (and to pass it on to the event handling
code of the superclass if you hit text), your own subclass of
NSTextContainer that
knows the current locations of your images, etc, etc
it isn't a trivial undertaking.
Bob
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden