4.4 Recording Drawing Contexts
class | ||||||
|
If record_ink is true, then drawing records ink effects so that RecordDC.ink_extent can report ink bounds.
Use RecordDC.get_draw to get a drawing function that replays the recorded drawing, or use RecordDC.get_record to get a value that can be serialized, deserialized, and converted to a drawing function with RecordDC.record_to_draw.
When drawing recorded actions, the target drawing context’s pen, brush, font, text, background, text background, and text foreground do not affect the recorded actions. The target drawing context’s transformation, alpha, and clipping region compose with settings in the recorded actions (so that, for example, a recorded action to set the clipping region actually intersects the region with the drawing context’s clipping region at the time that the recorded commands are replayed). After recoded commands are replayed, all settings in the target drawing context, such as its clipping region or current font, are as before the replay.
method | |
| |
function | |
A drawing function returned by RecordDC.record_to_draw behaves like one from RecordDC.get_draw.
Bounding drawing “ink” takes into account the visible effect of drawing with different pen widths and the shape of drawn text, as opposed to just collecting path coordinates and nominal text extents.
If ink record is not enabled for dc, RecordDC.ink_extent throws an exception.