public interface GettingCanvasSize
width
, height
as well as its overflow
. The following methods are available to retrieve the size of a canvas at runtime:
Canvas.getWidth() , Canvas.getHeight() | Returns the
specified size of the component in pixels. If height or width were specified as a
|
Canvas.getInnerWidth() , Canvas.getInnerHeight() |
Returns the amount of space available for absolutely positioned child widget(s) or absolutely positioned HTML content, without introducing clipping, scrolling or overflow. This is the space within the viewport of the widget (including padding, but excluding margins, borders or scrollbars) rendered at its specified size. |
Canvas.getInnerContentWidth() , Canvas.getInnerContentHeight() | Returns the amount of space available for relatively positioned child widget(s) or inline positioned HTML content, without introducing clipping, scrolling or overflow. This is the space within the viewport of the widget (not including padding, excluding margins, borders or scrollbars) rendered at its specified size. |
Canvas.getVisibleWidth() , Canvas.getVisibleHeight() |
Returns the drawn size of the component in pixels, (including border, margin and
scrollbars). If a widget is undrawn or has |
Canvas.getViewportWidth() ,
Canvas.getViewportHeight() |
Returns the drawn size of the component's viewport in pixels. This is the same value as
|
Canvas.getScrollWidth() , Canvas.getScrollHeight() |
Returns the scrollable size of the widget's content, including children.
For components with |