background image
C H A P T E R 1 3
Drawing and Graphics
13-22
Using the Drawing Interface
Notice that there are two types of pictures: bitmaps (a frame with
bits
, a
bounds
, and
mask
slots) and Format 1 PICTs (binary objects of class picture).
clPictureView
can draw both of these types of objects,
so you just need to choose a format and use
SetValue
on the
icon
slot,
as follows:
SetValue(myView, 'icon, kPictureAsBitMap);
or
SetValue(myView, 'icon, kPictureAsPict);
Optimizing Drawing Performance
13
You can use several methods to make drawing functions execute faster.
If you have a fairly static background picture, you can use a predefined PICT
resource. Create the PICT in your favorite drawing program, and use the PICT as
the background (
clIconView
). The graphics system also has a picture-making
function that enables you to create pictures that you can draw over and over again.
If you want to improve hit-testing of objects, use a larger view in combination with
a
ViewDrawScript
or a
ViewClickScript
rather than using smaller views
with an individual
ViewClickScript
. This is especially true of a view that
consists of regular smaller views.
© 2007-2017, o7 studio » при воспроизведении материала сайта ссылка обязательна