ftp.nice.ch/pub/next/developer/objc/fromnext/MiniExamples.91.9.s.tar.gz#/MiniExamples/Rotato

IB.proj
 
Info.tiff
 
Makefile
 
MyImage.h
[View MyImage.h] 
MyImage.m
[View MyImage.m] 
README.rtf
[View README.rtf] 
Rotato.iconheader
 

Rotato.nib


 
Rotato_main.m
[View Rotato_main.m] 
TestView.h
[View TestView.h] 
TestView.m
[View TestView.m] 
one.tiff
 
wraps.psw
 

README.rtf

Rotato
	by Henry Krempel, NeXT Developer Support
	(based very much on Ali Ozer's original)

A simple NXImage rotation example.

This example is intended to illustrate the steps necessary in rotating an NXImage.  A Custom View is shown that contains an NXImage.  A slider at the bottom allows you to rotate the image to any of the four 90Ê rotations (in the interest of simplifying the sizing of the NXImage, only these rotations were done). A button allows you to flip the image over.

The class that does the interesting work is MyImage.  This is a subclass of NXImage that does a number of interesting things:

·	It keeps track of the size of the NXImage.  When the image is rotated, the aspect ratio changes (width and height are exchanged).

·	Overrides the drawRepresentation:inRect: method, where PostScript rotation can be applied before the image is rendered.

Why is this interesting?

You may well ask.  NXImages are normally imaged into place using compositng operations (as is done in the "TestView" Custom View).  Compositing does not pay attention to PostScript's current transformation matrix (ctm),  so the rotate, scale, and translate operators have no effect. In Rotato, the image is rotated and rendered into an offscreen NXImage before it is composited.

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.