From Xojo Documentation

Read-Only Property (As Integer )
IntegerValue = aWebGraphics.Width

Supported for all project types and targets.

The width in pixels of the drawing areas of the parent WebCanvas.


This example gets the width of the parent WebCanvas and draws a line from the top left to top right:

Var w As Integer
w = g.Width
g.PenWidth = 5
g.DrawLine(0, 0, w, 0)