Display Documents: size and scaling |
Top Previous Next |
Display Document Size: A display document always has a size, which can be explicitly set.
If it is not set explicitly:
If it is set explicitly:
Displaying a Document: If a document is displayed on a device with scaling on:
If a document is displayed on a device with scaling off:
If event coordinates are turned on (see DisplayEventCoords) the coordinates reported are the document's coordinates, regardless of scaling.
Example: Here are two pictures of the same display, to the same scale, showing the same document, with scaling switched off:
… and on:
The document has not set its size explicitly, so it is scaled to the limit of the objects within it.
If we take the same document and set its size to 2000 x 2000, we would see the following on that monitor — with scaling off:
monitor (0,0) document (0,0) monitor (1279, 1023) document (1279, 1023)
(Note that if the document is larger than the monitor and is not being scaled, scroll bars appear; if you want the document to be clipped with no scroll bars, set the document to the exact size of the monitor.)
… and with scaling on:
monitor (0,0) document (0,0) monitor (1279, 1023) document (1999, 1999)
If the document set its size to something smaller than the limit of the objects within it, and scaling is switched on, then parts of the document will be clipped (just as if scaling is switched off and the document is larger than the physical display).
Note: documents are drawn faster when they are not being scaled (sometimes significantly, e.g. 12 ms versus 185 ms for a complete redraw of the document shown above on a 1020 x 717 non-exclusive, non-fullscreen DirectDraw window using a PIII-750 laptop with Whisker at 'normal' thread priority). This delay does not affect client communications (as redrawing is performed by a separate thread), and the time during which the visible display is being updated is less than 1 ms – for DirectDraw windows, the drawing routines draw to a memory buffer and then use a rapid technique for switching that memory to video RAM – thus, the 12/185 ms delay is the approximate lag from issuing a DisplayShowDocument command to the document appearing on the screen. If video performance is critical, use a full-screen DirectDraw window, switch WhiskerServer into real-time mode and do not scale documents.
Development note: benchmark these optimal conditions in CDisplayView.
|