background image
C H A P T E R 1 3
Drawing and Graphics
Using the Drawing Interface
13-15
Displaying Bitmaps, Pictures, and Graphics Shapes
13
You can use a view of the
clPictureView
class to display a bitmap, picture, or
graphic shape (polygon). The icon slot in this view can contain a bitmap, a picture
object, or a graphic shape.
Displaying Pictures in a clEditView
13
Use the
clEditView
view class to display and accept text and graphic data in a
view. Views of the
clEditView
class contain no data directly; instead, they have
child views that contain the individual data items. Pictures are contained in child
views of the class
clPictureView
. For details on displaying text, see "Using
Views and Protos for Text Input and Display" (page 8-6).
To add a picture to a
clEditView
, you need to create an appropriate template of
the
clPictureView
class, add the template to the
viewChildren
array, and
then open the view or call
RedoChildren
. You can also use the
AddView
method to add the picture to an existing view, and then mark the view as dirty so
that it will be redrawn.
The template holding the PICT items must contain the following slots:
viewStationery
--which must have the symbol
'pict
viewBounds
--which is a bounds frame; for example,
RelBounds(0,0,40,40)
icon
--which is a bitmap frame, a picture object, or a graphic shape
Displaying Scaled Images of Other Views
13
Use the
clRemoteView
view class to display a scaled image of another view.
This class can be used to show a page preview of a full-page view in a smaller
window, for example.
The view that you want to display inside the remote view should be specified as the
single child of the remote view. This child is always hidden, and is used internally
by the remote view to construct the scaled image.
A
clRemoteView
should never have more than one view, the scaled view,
otherwise the results are undefined and subject to change.
Here is an example of a view definition of the
clRemoteView
class:
myRemoteView := {...
viewclass: clRemoteView,
viewBounds: {left: 75, top: 203, right: 178,
bottom: 322},
viewFlags: vVisible+vReadOnly,
© 2007-2017, o7 studio » при воспроизведении материала сайта ссылка обязательна