Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
Clippings/ScaleAndRotate.c/Rotate.txt
// set the contents of a matrix so that it performs no transformation |
SetIdentityMatrix( &matrix ); |
// modify the contents of a matrix so that it defines a rotation operation |
// 90 degrees to the right - anchor at 0.0 top-left |
RotateMatrix( &matrix, // pointer to the matrix structure |
Long2Fix( 90 ), // the number of degrees of rotation NOTE: THIS IS A FIXED VALUE |
0, // x coordinate of anchor point |
0 ); // y coordinate of anchor point |
// we need to return the top-left corner of the rotated image back to it's |
// origin, so add a translation value to a specified matrix |
TranslateMatrix( &matrix, // pointer to the matrix structure |
Long2Fix( naturalBounds.bottom ), // deltaH - value added to the x coordinate NOTE: FIXED VALUES |
0 ); // deltaV - value added to the y coordinate |
// set the transformation matrix to use for drawing an image |
err = GraphicsImportSetMatrix( importer, &matrix ); |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14