Importing Color PICTs from the Mac OS Version of NTK
You can use the Mac OS version of NTK to import PICTs into your package as either a picture object or as a pix family. The following sections describe what you can do with a picture object or pix families.Creating Graphic Shapes from Picture Objects
A picture object, sometimes called a Newton PICT, is an object that consists of primitive drawing commands. It is basically the same data structure as a Mac OS PICT. In most cases, a picture object is smaller than a pix family, but may draw slower.You can incorporate a picture object in your package using the existing NTK functions
GetResource
andGetNamedResource
. Once a picture object has been included in a package you can render it by converting it to a graphic shape. 16 and 32 bit PICTs can only be imported with these two functions. You cannot create a pix family from such a PICT.There are two ways to transform the picture object into a graphic shape. You can use the existing function *
MakeShape
, or the new function *PictToShape
. These functions use different algorithms to transform the picture object to a shape. *MakeShape
returns a single picture shape, which is basically a wrapper around the PICT. *PictToShape
on the other hand, returns an array of shapes derived from the PICT's own drawing commands.
- Note
- The PICT itself could contain either drawing commands, such as "draw a circle here," "fill this rectangle in black," or it could contain bitmap-based data. If the PICT contains drawing commands, *
PictToShape
creates an array of shapes based on those commands, which is generally a smaller object. However if the PICT contains bitmap-based information, use of these two functions is basically equivalent.![]()
Using Pix Families
You can create a pix family from a PICT by using either the picture slot editor in NTK, or programmatically with the NTK function *MakePixFamily
.*MakePixFamily
replaces the deprecated functionGetPictAsBits
. Pix families can be used anywhere bitmaps are allowed. They can be rendered when used as the value of theicon
slot of aclPictureView
, or in thepickItems
array of a popup menu item, etc. A pix family can be drawn directly on the screen with theCopyBits
function. You can create a bitmap shape from the pix family with *MakeShape
.The picture slot editor is provided for the
icon
slot ofclPictureView
s. It creates a pix family. For more information on this slot editor, see "Picture Slot Editor". The existing NTK functionGetPictAsBits
, has not been modified, and returns an old-style black and white bitmap. If you want to create a pix family programmatically, you must use the new NTK function*MakePixFamily
.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help