fillText method

[This documentation is preliminary and is subject to change.]

Renders filled text to the canvas by using the current fill style and font.

HTML Canvas 2D Context, Section 11Internet Explorer 9

Syntax

HRESULT retVal = object.fillText(text, x, y, maxWidth);

Standards information

Parameters

  • text [in]
    Type: BSTR

    The text characters to paint on the canvas.

  • x [in]
    Type: float

    The horizontal coordinate to start painting the text at, relative to the canvas.

  • y [in]
    Type: float

    The vertical coordinate to start painting the text, relative to the canvas.

  • maxWidth [in, optional]
    Type: VARIANT

    The maximum possible text width. If the value is less than the width property, the text is scaled to fit.

Return value

Type: HRESULT

This method can return one of these values.

Return code Description
S_OK

The operation completed successfully.

W3CException_DOM_SECURITY_ERR

The current font is not of the same origin or domain as the document that owns the canvas element.

 

 

 

Build date: 1/23/2012