Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Environment and Utilities /
Chapter 1 - QuickDraw GX and the Macintosh Environment / Using the QuickDraw-to-QuickDraw GX Translator


Using the Translator With QuickDraw Pictures

If you have a handle to QuickDraw picture data, such as from a file or on the Clipboard, you can convert that data into a QuickDraw GX picture shape with a single call to the QuickDraw-to-QuickDraw GX translator.

You use the GXConvertPICTToShape function to translate an entire QuickDraw picture into a QuickDraw GX shape. You pass the picture handle of the QuickDraw picture you wish to translate and a reference to a shape into which the translated data is to be placed. Listing 1-4 is a sample that uses the GXConvertPICTToShape function to perform the translation, and then draws the resultant picture shape to the view port specified in the view port array thePorts.

Listing 1-4 Translating QuickDraw picture data with GXConvertPICTToShape

aPicShape = GXNewShape(gxPictureType);

GXConvertPICTToShape(thePicHdl, gxDefaultOptionsTranslation, 
                     &theRect, &theRect, styleStretch, 
                     aPicShape, nil);

GXSetShapeViewPorts(aPicShape,1,thePorts);
GXDrawShape(aPicShape);
GXDisposeShape(aPicShape);

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996