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: Imaging With QuickDraw /
Chapter 7 - Pictures / Pictures Reference
Data Structures /


OpenCPicParams

When you use the OpenCPicture function (described on page 7-36) to begin creating a picture, you must pass it information in an OpenCPicParams record. This record provides a simple mechanism for specifying resolutions when creating images. For example, applications that create pictures from scanned images can specify resolutions higher than 72 dpi for these pictures in OpenCPicParams records.

An OpenCPicParams record is defined as follows:

TYPE OpenCPicParams = 
RECORD
   srcRect:    Rect;       {optimal bounding rectangle for }
                           { displaying picture at resolution }
                           { indicated in hRes, vRes fields}
   hRes:       Fixed;      {best horizontal resolution; }
                           { $00480000 specifies 72 dpi}
   vRes:       Fixed;      {best vertical resolution; }
                           { $00480000 specifies 72 dpi}
   version:    Integer;    {set to -2}
   reserved1:  Integer;    {reserved; set to 0}
   reserved2:  LongInt;    {reserved; set to 0}
END;
Field Description
srcRect
The optimal bounding rectangle for the resolution indicated by the next two fields. When you later call the DrawPicture procedure (described on page 7-43) to play back the saved picture, you supply a destination rectangle, and DrawPicture scales the picture so that it is completely aligned with the destination rectangle. To display a picture at a resolution other than that specified in the next two fields, your application should compute an appropriate destination rectangle by scaling its width and height by the following factor:
scale factor = destination resolution / source resolution
hRes
The best horizontal resolution for the picture. Notice that this value is of type Fixed--a value of $0048000 specifies a horizontal resolution of 72 dpi.
vRes
The best vertical resolution for the picture. Notice that this value is of type Fixed--a value of $00480000 specifies a horizontal resolution of 72 dpi.
version
Always set this field to -2.
reserved1
Reserved; set to 0.
reserved2
Reserved; set to 0.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996