Important: The information in this document is obsolete and should not be used for new development.
PictInfo
When you use theGetPictInfofunction (described on page 7-46) to collect information about a picture, or when you use theGetPixMapInfofunction (described on page 7-49) to collect color information about a pixel map or bitmap, the function returns the information in aPictInforecord. When you gather this information for multiple pictures, pixel maps, or bitmaps, theRetrievePictInfofunction (described on page 7-57) also returns aPictInforecord containing this information.Initially, all of the fields in a new
PictInforecord are set toNIL. Relevant fields are set to appropriate values depending on the information you request using the Picture Utilities functions as described in this chapter.The
PictInforecord is defined as follows:
TYPE PictInfo = RECORD version: Integer; {Picture Utilities version number} uniqueColors: LongInt; {total colors in survey} thePalette: PaletteHandle; {handle to a Palette record--NIL for } { a bitmap in a basic graphics port} theColorTable: CTabHandle; {handle to a ColorTable record--NIL } { for a bitmap in a basic graphics } { port} hRes: Fixed; {best horizontal resolution (dpi)} vRes: Fixed; {best vertical resolution (dpi)} depth: Integer; {greatest pixel depth} sourceRect: Rect; {optimal bounding rectangle for } { picture for display at resolution } { specified in hRes and vRes fields} textCount: LongInt; {number of text strings in picture(s)} lineCount: LongInt; {number of lines in picture(s)} rectCount: LongInt; {number of rectangles in picture(s)} rRectCount: LongInt; {number of rounded rectangles in } { picture(s)} ovalCount: LongInt; {number of ovals in picture(s)} arcCount: LongInt; {number of arcs and wedges in } { picture(s)} polyCount: LongInt; {number of polygons in picture(s)} regionCount: LongInt; {number of regions in picture(s)} bitMapCount: LongInt; {number of bitmaps} pixMapCount: LongInt; {number of pixel maps} commentCount: LongInt; {number of comments in picture(s)} uniqueComments: LongInt; {number of different comments } { (by ID) in picture(s)} commentHandle: CommentSpecHandle;{handle to an array of CommentSpec } { records for picture(s)} uniqueFonts: LongInt; {number of fonts in picture(s)} fontHandle: FontSpecHandle; {handle to an array of FontSpec } { records for picture(s)} fontNamesHandle: Handle; {handle to list of font names for } { picture(s)} reserved1: LongInt; reserved2: LongInt; END;When you are finished with this information, be sure to dispose of it. You can dispose of
Field Description
version- The version number of the Picture Utilities, currently set to 0.
uniqueColors- The number of colors in the picture specified to the
GetPictInfofunction, or the number of colors in the pixel map or bitmap specified to theGetPixMapInfofunction, or the total number of colors for all the pictures, pixel maps, and bitmaps returned by theRetrievePictInfofunction. The number of colors returned in this field is limited by the accuracy of the Picture Utilities' color bank for color storage. See "Application-Defined Routines" beginning on page 7-60 for information about the Picture Utility's color bank and about how you can create your own for selecting colors.thePalette- A handle to the resulting
Paletterecord if you specified to theGetPictInfo,GetPixMapInfo, orNewPictInfofunction that colors be returned in aPaletterecord. ThatPaletterecord contains either the number of colors you specified to the function or--if there aren't that many colors in the pictures, pixel maps, or bitmaps--the number of colors found. Depending on the constant you pass in theverbparameter to the function, thePaletterecord contains either the most used or the widest range of colors in the pictures, pixel maps, and bitmaps. On Macintosh computers running basic QuickDraw only, this field is always returned asNIL. See the chapter "Palette Manager" in Advanced Color Imaging on the Mac OS for more information aboutPaletterecords.theColorTable- A handle to the resulting
ColorTablerecord if you specified to theGetPictInfo,GetPixMapInfo, orNewPictInfofunction that colors be returned in aColorTablerecord. If the pictures, pixel maps, or bitmaps contain fewer colors found than you specified to the function, the unused entries in theColorTablerecord are filled with black. Depending on the constant you pass in theverbparameter to the function, theColorTablerecord contains either the most used or the widest range of colors in the pictures, pixel maps, and bitmaps. The chapter "Color QuickDraw" in this book describesColorTablerecords. On Macintosh computers running basic QuickDraw only, this field is always returned asNIL.- If a picture has more than 256 colors or has pixel depths of 32 bits, then Color QuickDraw translates the colors in the
ColorTablerecord to 16-bit depths. In such a case, the returned colors might have a slight loss of resolution, and theuniqueColorsfield reflects the number of colors distinguishable at that pixel depth.hRes- The horizontal resolution of the current picture, pixel map, or bitmap retrieved by the
GetPictInfoorGetPixMapInfofunction; the greatest horizontal resolution from all pictures, pixel maps, and bitmaps retrieved by theRetrievePictInfofunction.vRes- The vertical resolution of the current picture, pixel map, or bitmap retrieved by the
GetPictInfoorGetPixMapInfofunction; the greatest vertical resolution of all pictures, pixel maps, and bitmaps retrieved by theRetrievePictInfofunction. Note that although the values of thehResandvResfields are usually the same, they don't have to be.depth- The pixel depth of the picture specified to the
GetPictInfofunction or the pixel map specified to theGetPixMapInfofunction. When you use theRetrievePictInfofunction, this field contains the deepest pixel depth of all pictures or pixel maps retrieved by the function.sourceRect- The optimal bounding rectangle for displaying the picture at the resolution indicated by the
hResandvResfields. The upper-left corner of the rectangle is always (0,0). Pictures created with theOpenCPicturefunction have thehRes,vRes, andsourceRectfields built into theirPicturerecords. For pictures created byOpenPicture, thehResandvResfields are set to 72 dpi, and the source rectangle is calculated using thepicFramefield of thePicturerecord for the picture.textCount- The number of text strings in the picture specified to the
GetPictInfofunction, or the total number of text objects in all the pictures retrieved by theRetrievePictInfofunction. For pixel maps and bitmaps specified toGetPixMapInfoorRetrievePictInfo, this field is set to 0.lineCount- The number of lines in the picture specified to the
GetPictInfofunction, or the total number of lines in all the pictures retrieved by theRetrievePictInfofunction. For pixel maps and bitmaps, this field is set to 0.rectCount- The number of rectangles in the picture specified to the
GetPictInfofunction, or the total number of rectangles in all the pictures retrieved by theRetrievePictInfofunction. For pixel maps and bitmaps, this field is set to 0.rRectCount- The number of rounded rectangles in the picture specified to the
GetPictInfofunction, or the total number of rounded rectangles in all the pictures retrieved by theRetrievePictInfofunction. For pixel maps and bitmaps, this field is set to 0.ovalCount- The number of ovals in the picture specified to the
GetPictInfofunction, or the total number of ovals in all the pictures retrieved by theRetrievePictInfofunction. For pixel maps and bitmaps, this field is set to 0.arcCount- The number of arcs and wedges in the picture specified to the
GetPictInfofunction, or the total number of arcs and wedges in all the pictures retrieved by theRetrievePictInfofunction. For pixel maps and bitmaps, this field is set to 0.polyCount- The number of polygons in the picture specified to the
GetPictInfofunction, or the total number of polygons in all the pictures retrieved by theRetrievePictInfofunction. For pixel maps and bitmaps, this field is set to 0.regionCount- The number of regions in the picture specified to the
GetPictInfofunction, or the total number of regions in all the pictures retrieved by theRetrievePictInfofunction. For pixel maps and bitmaps, this field is set to 0.bitMapCount- The total number of bitmaps in the survey.
pixMapCount- The total number of pixel maps in the survey.
commentCount- The number of comments in the picture specified to the
GetPictInfofunction, or the total number of comments in all the pictures retrieved by theRetrievePictInfofunction. This field is valid only if you specified to theGetPictInfoorNewPictInfofunction that comments be returned in aCommentSpecrecord, described on page 7-29. For pixel maps and bitmaps, this field is set to 0.uniqueComments- The number of picture comments that have different IDs in the picture specified to the
GetPictInfofunction, or the total number of picture comments with different IDs in all the pictures retrieved by theRetrievePictInfofunction. (The values for many common IDs are listed in Appendix B, "Using Picture Comments for Printing," in this book.) This field is valid only if you specify that comments be returned in aCommentSpecrecord. For pixel maps and bitmaps, this field is set to 0.commentHandle- A handle to an array of
CommentSpecrecords, described on page 7-29. For pixel maps and bitmaps, this field is set toNIL.uniqueFonts- The number of different fonts in the picture specified to the
GetPictInfofunction, or the total number of different fonts in all the pictures retrieved by theRetrievePictInfofunction. For bitmap fonts, a font is a complete set of glyphs in one size, typeface, and style--for example, 12-point Geneva italic. For outline fonts, a font is a complete set of glyphs in one typeface and style--for example, Geneva italic.- This field is valid only if you specify that fonts be returned in a
FontSpecrecord, which is described on page 7-29. For pixel maps and bitmaps, this field is set to 0.fontHandle- A handle to a list of
FontSpecrecords, described on page 7-29. For pixel maps and bitmaps, this field is set toNIL.fontNamesHandle
A handle to the names of the fonts in the picture retrieved by theGetPictInfofunction or the pictures retrieved by theRetrievePictInfofunction. The offset to a particular name is stored in thenameOffsetfield of theFontSpecrecord for that font. A font name is a name, such as Geneva, given to one font family to distinguish it from other font families.Paletterecords by using theDisposePaletteprocedure (which is described in the chapter "Palette Manager" in Advanced Color Imaging on the Mac OS). You can dispose ofColorTablerecords by using theDisposeCTableprocedure (described in the chapter "Color QuickDraw" in this book). You can dispose of other allocations with theDisposeHandleprocedure (described in Inside Macintosh: Memory).