Lana N. Lindberg, Software Applications Engineer for the Intel® Atom ™ Processor
The Desktop Rotation sample app shows how screen orientation changes can be detected in the desktop environment. The app, written in C++, uses reported values to modify the window display. When the code starts, the app creates a default dimensions window with three child windows arranged in a preset way. Each child window contains an image. The app detects screen rotation, modifies window size to hardcoded values, changes window orientation, and rearranges child windows in a different preset way. In Portrait mode the child windows are arranged vertically on top of one another. In Landscape mode the child windows are arranged in more of a side-by-side fashion to better take advantage of the extra horizontal space. By monitoring the display changes based on screen width and height, the app knows exactly when the desktop has been rotated and can adjust its content for the new mode. The images indicate where each child window moved.
Download Source Code
Desktop Rotation - Landscape and Portrait Sample Images
Figure 1: Landscape
Figure 2: Portrait
Intel sample sources are provided to users under the Intel Sample Source Code License Agreement