Skip navigation.
 
mlRe: Help with pixellated NSTIFFRepresentation issues much appreciated
FROM : Robert Clair
DATE : Wed Oct 13 16:34:35 2004

>  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

Related mailsAuthorDate
mlRe: Help with pixellated NSTIFFRepresentation issues much appreciated Robert Clair Oct 6, 22:58
mlRe: Help with pixellated NSTIFFRepresentation issues much appreciated Keith Blount Oct 8, 13:41
mlRe: Help with pixellated NSTIFFRepresentation issues much appreciated Robert Clair Oct 8, 16:58
mlRe: Help with pixellated NSTIFFRepresentation issues much appreciated Keith Blount Oct 12, 21:39
mlRe: Help with pixellated NSTIFFRepresentation issues much appreciated Aaron Fothergill Oct 12, 21:46
mlRe: Help with pixellated NSTIFFRepresentation issues much appreciated Robert Clair Oct 13, 16:34