Window rotation

Window rotation affects the source coordinate system.

The rotation of a window is described by its SCREEN_PROPERTY_ROTATION property. The term rotation in this context isn't a true rotation where an object rotates around an axis or center. Screen's window rotation is, in fact, a transformation that includes rotation, translation and scaling. When you change this property, you are effectively transforming the source (or buffer) coordinate system for the associated window. This transformation is how the content of your window rotates. After rotating the source coordinates as specified by the SCREEN_PROPERTY_ROTATION property, Screen applies a translation and scaling on the content to fit the bounds of the window dimensions where applicable. If required, you can modify this scaling behavior to suit your application by setting the window's SCREEN_PROPERTY_SCALE_MODE property.

Changes to a window's rotation don't affect its size or position because these are display-related properties. See the "Window properties" section for more information on the display and source coordinate systems.

The following example shows what happens when you set the window's SCREEN_PROPERTY_ROTATION property to 90 (to achieve a rotation of 90 degrees clockwise):

Child windows

The following are considered child windows:

For child windows their rotation is relative to their parent.

The following example shows what happens when you set a window's SCREEN_PROPERTY_ROTATION property to 90 (to achieve a rotation of 90 degrees clockwise), but leave the rotation of its child window unchanged: