Renderer.Draw Method

Renderer.Draw Method

Draws strokes on a Graphics Leave Site or device context.

Overload List

public void Draw(Graphics, Stroke)
public void Draw(Graphics, Stroke, DrawingAttributes)
public void Draw(Graphics, Strokes)
public void Draw(IntPtr, Stroke)
public void Draw(IntPtr, Stroke, DrawingAttributes)
public void Draw(IntPtr, Strokes)


Important Security InformationSecurity Alert: For managed code, use the appropriate overload that accepts a Graphics Leave Site object instead of the one that accepts an IntPtr Leave Site; otherwise, you need to hold on to the handle in such a way that results in a memory leak. The overloads that accept an hdc parameter are useful if you are using resources that are unmanaged code.

The pen width is adjusted appropriately, based on how you use SetViewTransform method. Specifically, the pen width is multiplied (or scaled) by the square root of the determinant of the view transform.

Note: If you have not set the pen width explicitly, it is 53 by default. You must multiply the pen width by the square root of the determinant to yield the correct bounding box. The height and width of the bounding box are expanded by half this amount in each direction.

For example, consider that the pen width is 53, the square root of the determinant is 50, and the bounding box is (0,0,1000,1000). The pen width adjustment to the bounding box in each direction is calculated as (53*50)/2, and the right and bottom sides are incremented by one. This results in a rendered bounding box of (-1325,-1325,2326,2326).

The Renderer object forces the viewport and window origins to 0,0. Any existing settings are saved and restored, but are not used by the Renderer. To perform scrolling, use the Renderer object's GetViewTransform and GetObjectTransform methods.


See Also