Drawing Three-Dimensional Shapes and Text
You can draw a variety of three-dimensional shapes and text objects in the LEAD control's client area or directly on the bitmap. Possible shapes are stars, rectangles, triangles, and so forth. For a complete list, refer to the DrawShape method. The text objects can be rotated to any angle, specified in tenths of degrees.
For shapes and text:
The following property determines whether the shape or text object is drawn to the control's client area or to the bitmap:
The following properties specify the color and offsets that apply a drop shadow to the shape or text object:
To turn off the shadow, set the X and Y depths to 0.
With text objects, the drop shadow is disabled with some styles, as shown in the following examples: Style with a Shadow and Style without a Shadow.
For shapes only:
Use the following method (with related properties) to draw a specified shape.
The following properties specify the position and size of the shape:
The following property specifies the background style of the shape:
For foreground patterns and colors, use the pattern properties described in to Gradients and Patterns. The following example shows how a fill pattern can be implemented: Shape with a Fill Pattern and Drop Shadow.
If the shape uses an image as its background, the following properties specify the source rectangle that defines which part of the bitmap to use for the background:
BackgroundImageHeight property
The following properties specify the primary lines of the shape:
The following properties specify the inner and outer bands that give the lines of the shape a three-dimensional appearance:
ShapeInnerBandHiliteColor property
ShapeInnerBandShadowColor property
ShapeInnerBandThickness property
ShapeOuterBandHiliteColor property
ShapeOuterBandShadowColor property
ShapeOuterBandThickness property
Inner bands apply only to rectangles and squares (not other shapes). The three-dimensional effects are most effective when you specify the inner band or outer band (but not both), as shown in the following examples: Inner band raised, Inner band inset, Outer band raised, and Outer band inset.
For text only:
Use the following method (with related properties) to draw a text object:
You can create an image that consists of a pattern or gradient color to use as a foreground of the text. Refer to Gradients and Patterns for related properties.
The following properties specify the bounding rectangle for the text object and the alignment of the text object in the rectangle:
The following properties specify the font and style of the text object:
Use the following methods to get the width and height that are required for a specified text string using the current property settings for text objects:
These methods measure a single line of text (rotated or unrotated). They disregard the TextWordWrap property.