Height of the Py5Graphics drawing surface in pixels.
Height of the Py5Graphics drawing surface in pixels. When
pixel_density(2) was used in
settings() to make use of a high resolution display (called a Retina display on OSX or high-dpi on Windows and Linux), the width and height of the Py5Graphics drawing surface does not change, but the number of pixels is doubled. As a result, all operations that use pixels (like Py5Graphics.load_pixels(), Py5Graphics.get(), etc.) happen in this doubled space. As a convenience, the variables Py5Graphics.pixel_width and
pixel_height hold the actual width and height of the drawing surface in pixels. This is useful for any Py5Graphics objects that use the Py5Graphics.pixels or Py5Graphics.np_pixels arrays, for instance, because the number of elements in each array will be
This field is the same as pixel_height but linked to a
Py5Graphics object. To see example code for how it can be used, see pixel_height.
Underlying Processing field: PGraphics.pixelHeight
Updated on August 25, 2022 20:01:47pm UTC