Skip to content

Size

A 2D size with width and height.

属性 ​

名称类型默认值说明
widthNumberrequiredThe horizontal extent of the size.
heightNumberrequiredThe vertical extent of the size.

只读属性 ​

名称类型默认值说明
aspect_ratiofloat—Returns the aspect ratio (width / height).

方法 ​

名称类型默认值说明
is_infinitebool—Checks if either dimension is infinite.
is_finitebool—Checks if both dimensions are finite.
square'Size'—Creates a square Size where width and height are the same.
from_width'Size'—Creates a Size with the given width and an infinite height.
from_height'Size'—Creates a Size with the given height and an infinite width.
from_radius'Size'—Creates a square Size whose width and height are twice the given radius.
zero——Creates a Size whose width and height are both 0.0.
infinite——Creates a Size whose width and height are both positive infinity.
copy'Size'—返回此对象的副本,可覆盖指定属性。

关注我,学习大模型、大数据、Python等热门技术。