textAlign property
Gets or sets the current anchor point or alignment settings for text in the current context.
![]() ![]() |
Syntax
HRESULT value = object.put_textAlign( v);HRESULT value = object.get_textAlign(* p);
Property values
Type: BSTR
start
-
Default. If the canvas is left-to-right, the anchor point is the left edge of the text. If the canvas is right-to-left, the anchor point is the right edge of the text.
end
-
If the canvas is left-to-right, the anchor point is the right edge of the text. If the canvas is right-to-left, the anchor point is the left edge of the text.
left
-
The anchor point is the left edge of the text.
right
-
The anchor point is the right edge of the text.
center
-
The anchor point is centered in the text.
Standards information
- HTML Canvas 2D Context, Section 11
Remarks
The exact alignment depends on whether the direction of IHTMLCanvasElement is left-to-right (ltr) or right-to-left (rtl). The ICanvasRenderingContext2D::textBaseline value also determines the anchor point of the text.
Build date: 11/12/2012

