The Graphics subsystem provides graphics and window management capabilities, which can be invoked by using Java or JS APIs. It can be used for UI development for all standard-system devices.
<tdclass="cellrowborder"valign="top"width="63%"headers="mcps1.1.3.1.2 "><pid="p136mcpsimp"><aname="p136mcpsimp"></a><aname="p136mcpsimp"></a>Obtains the pointer to a singleton <strongid="b18411195111456"><aname="b18411195111456"></a><aname="b18411195111456"></a>WindowManager</strong> instance.</p>
<tdclass="cellrowborder"valign="top"width="63%"headers="mcps1.1.3.1.2 "><pid="p141mcpsimp"><aname="p141mcpsimp"></a><aname="p141mcpsimp"></a>Obtains the width of the screen.</p>
<tdclass="cellrowborder"valign="top"width="63%"headers="mcps1.1.3.1.2 "><pid="p146mcpsimp"><aname="p146mcpsimp"></a><aname="p146mcpsimp"></a>Obtains the height of the screen.</p>
<tdclass="cellrowborder"valign="top"width="63%"headers="mcps1.1.3.1.2 "><pid="p151mcpsimp"><aname="p151mcpsimp"></a><aname="p151mcpsimp"></a>Creates a standard window.</p>
<tdclass="cellrowborder"valign="top"width="63%"headers="mcps1.1.3.1.2 "><pid="p156mcpsimp"><aname="p156mcpsimp"></a><aname="p156mcpsimp"></a>Creates a child window.</p>
<tdclass="cellrowborder"valign="top"width="63%"headers="mcps1.1.3.1.2 "><pid="p161mcpsimp"><aname="p161mcpsimp"></a><aname="p161mcpsimp"></a>Takes a screenshot.</p>
<tdclass="cellrowborder"valign="top"width="63%"headers="mcps1.1.3.1.2 "><pid="p166mcpsimp"><aname="p166mcpsimp"></a><aname="p166mcpsimp"></a>Captures a window.</p>
<tdclass="cellrowborder"valign="top"width="63%"headers="mcps1.1.3.1.2 "><pid="p171mcpsimp"><aname="p171mcpsimp"></a><aname="p171mcpsimp"></a>Moves the specified window to the top.</p>
<tdclass="cellrowborder"valign="top"width="52%"headers="mcps1.1.3.1.2 "><pid="p190mcpsimp"><aname="p190mcpsimp"></a><aname="p190mcpsimp"></a>Displays the current window.</p>
<tdclass="cellrowborder"valign="top"width="52%"headers="mcps1.1.3.1.2 "><pid="p195mcpsimp"><aname="p195mcpsimp"></a><aname="p195mcpsimp"></a>Hides the current window.</p>
<tdclass="cellrowborder"valign="top"width="52%"headers="mcps1.1.3.1.2 "><pid="p200mcpsimp"><aname="p200mcpsimp"></a><aname="p200mcpsimp"></a>Moves the current window to a specified position.</p>
<tdclass="cellrowborder"valign="top"width="52%"headers="mcps1.1.3.1.2 "><pid="p205mcpsimp"><aname="p205mcpsimp"></a><aname="p205mcpsimp"></a>Moves the current window to the top.</p>
<tdclass="cellrowborder"valign="top"width="52%"headers="mcps1.1.3.1.2 "><pid="p210mcpsimp"><aname="p210mcpsimp"></a><aname="p210mcpsimp"></a>Changes the type of the current window.</p>
<tdclass="cellrowborder"valign="top"width="52%"headers="mcps1.1.3.1.2 "><pid="p215mcpsimp"><aname="p215mcpsimp"></a><aname="p215mcpsimp"></a>Resizes the current window.</p>
<tdclass="cellrowborder"valign="top"width="52%"headers="mcps1.1.3.1.2 "><pid="p220mcpsimp"><aname="p220mcpsimp"></a><aname="p220mcpsimp"></a>Rotates the current window.</p>
<tdclass="cellrowborder"valign="top"width="51%"headers="mcps1.1.3.1.2 "><pid="p339mcpsimp"><aname="p339mcpsimp"></a><aname="p339mcpsimp"></a>Moves the current child window.</p>
<tdclass="cellrowborder"valign="top"width="51%"headers="mcps1.1.3.1.2 "><pid="p344mcpsimp"><aname="p344mcpsimp"></a><aname="p344mcpsimp"></a>Sets the size of the current child window.</p>
<tdclass="cellrowborder"valign="top"width="59%"headers="mcps1.1.3.1.2 "><pid="p363mcpsimp"><aname="p363mcpsimp"></a><aname="p363mcpsimp"></a>Creates a surface for the buffer consumer.</p>
<tdclass="cellrowborder"valign="top"width="59%"headers="mcps1.1.3.1.2 "><pid="p368mcpsimp"><aname="p368mcpsimp"></a><aname="p368mcpsimp"></a>Creates a surface for the buffer producer. Only production-related APIs can be used.</p>
<tdclass="cellrowborder"valign="top"width="59%"headers="mcps1.1.3.1.2 "><pid="p373mcpsimp"><aname="p373mcpsimp"></a><aname="p373mcpsimp"></a>Obtains an internal <strongid="b1982865713319"><aname="b1982865713319"></a><aname="b1982865713319"></a>IBufferProducer</strong> object of <strongid="b14235152710419"><aname="b14235152710419"></a><aname="b14235152710419"></a>Surface</strong>.</p>
<tdclass="cellrowborder"valign="top"width="59%"headers="mcps1.1.3.1.2 "><pid="p378mcpsimp"><aname="p378mcpsimp"></a><aname="p378mcpsimp"></a>Requests a <strongid="b17591192851510"><aname="b17591192851510"></a><aname="b17591192851510"></a>SurfaceBuffer</strong> object to be produced.</p>
<tdclass="cellrowborder"valign="top"width="59%"headers="mcps1.1.3.1.2 "><pid="p383mcpsimp"><aname="p383mcpsimp"></a><aname="p383mcpsimp"></a>Cancels a <strongid="b11160135061513"><aname="b11160135061513"></a><aname="b11160135061513"></a>SurfaceBuffer</strong> object to be produced.</p>
<tdclass="cellrowborder"valign="top"width="59%"headers="mcps1.1.3.1.2 "><pid="p388mcpsimp"><aname="p388mcpsimp"></a><aname="p388mcpsimp"></a>Flushes a produced <strongid="b19478235151718"><aname="b19478235151718"></a><aname="b19478235151718"></a>SurfaceBuffer</strong> object with certain information.</p>
<tdclass="cellrowborder"valign="top"width="59%"headers="mcps1.1.3.1.2 "><pid="p393mcpsimp"><aname="p393mcpsimp"></a><aname="p393mcpsimp"></a>Requests a <strongid="b4187111419210"><aname="b4187111419210"></a><aname="b4187111419210"></a>SurfaceBuffer</strong> object to be consumed.</p>
<tdclass="cellrowborder"valign="top"width="59%"headers="mcps1.1.3.1.2 "><pid="p403mcpsimp"><aname="p403mcpsimp"></a><aname="p403mcpsimp"></a>Obtains the number of concurrent buffers.</p>
<tdclass="cellrowborder"valign="top"width="59%"headers="mcps1.1.3.1.2 "><pid="p408mcpsimp"><aname="p408mcpsimp"></a><aname="p408mcpsimp"></a>Sets the number of concurrent buffers.</p>
<tdclass="cellrowborder"valign="top"width="59%"headers="mcps1.1.3.1.2 "><pid="p413mcpsimp"><aname="p413mcpsimp"></a><aname="p413mcpsimp"></a>Sets the default width and height.</p>
<tdclass="cellrowborder"valign="top"width="59%"headers="mcps1.1.3.1.2 "><pid="p418mcpsimp"><aname="p418mcpsimp"></a><aname="p418mcpsimp"></a>Obtains the default width.</p>
<tdclass="cellrowborder"valign="top"width="59%"headers="mcps1.1.3.1.2 "><pid="p423mcpsimp"><aname="p423mcpsimp"></a><aname="p423mcpsimp"></a>Obtains the default height.</p>
<tdclass="cellrowborder"valign="top"width="59%"headers="mcps1.1.3.1.2 "><pid="p428mcpsimp"><aname="p428mcpsimp"></a><aname="p428mcpsimp"></a>Stores string data, which will not be transferred through IPC.</p>
<tdclass="cellrowborder"valign="top"width="59%"headers="mcps1.1.3.1.2 "><pid="p438mcpsimp"><aname="p438mcpsimp"></a><aname="p438mcpsimp"></a>Registers a consumer listener to listen for buffer flush events.</p>
<tdclass="cellrowborder"valign="top"width="59%"headers="mcps1.1.3.1.2 "><pid="p443mcpsimp"><aname="p443mcpsimp"></a><aname="p443mcpsimp"></a>Unregiseters a consumer listener.</p>
<tdclass="cellrowborder"valign="top"width="68%"headers="mcps1.1.3.1.2 "><pid="p462mcpsimp"><aname="p462mcpsimp"></a><aname="p462mcpsimp"></a>Obtains the <strongid="b15990748192713"><aname="b15990748192713"></a><aname="b15990748192713"></a>BufferHandle</strong> pointer to the <strongid="b10706250132715"><aname="b10706250132715"></a><aname="b10706250132715"></a>SurfaceBuffer</strong> object.</p>
<tdclass="cellrowborder"valign="top"width="68%"headers="mcps1.1.3.1.2 "><pid="p467mcpsimp"><aname="p467mcpsimp"></a><aname="p467mcpsimp"></a>Obtains the width of the <strongid="b109605268315"><aname="b109605268315"></a><aname="b109605268315"></a>SurfaceBuffer</strong> object.</p>
<tdclass="cellrowborder"valign="top"width="68%"headers="mcps1.1.3.1.2 "><pid="p472mcpsimp"><aname="p472mcpsimp"></a><aname="p472mcpsimp"></a>Obtains the height of the <strongid="b142632918311"><aname="b142632918311"></a><aname="b142632918311"></a>SurfaceBuffer</strong> object.</p>
<tdclass="cellrowborder"valign="top"width="68%"headers="mcps1.1.3.1.2 "><pid="p477mcpsimp"><aname="p477mcpsimp"></a><aname="p477mcpsimp"></a>Obtains the color format of the <strongid="b11157143123112"><aname="b11157143123112"></a><aname="b11157143123112"></a>SurfaceBuffer</strong> object.</p>
<tdclass="cellrowborder"valign="top"width="68%"headers="mcps1.1.3.1.2 "><pid="p482mcpsimp"><aname="p482mcpsimp"></a><aname="p482mcpsimp"></a>Obtains the usage of the <strongid="b15685153383114"><aname="b15685153383114"></a><aname="b15685153383114"></a>SurfaceBuffer</strong> object.</p>
<tdclass="cellrowborder"valign="top"width="68%"headers="mcps1.1.3.1.2 "><pid="p487mcpsimp"><aname="p487mcpsimp"></a><aname="p487mcpsimp"></a>Obtains the physical address of the <strongid="b1569003614310"><aname="b1569003614310"></a><aname="b1569003614310"></a>SurfaceBuffer</strong> object.</p>
<tdclass="cellrowborder"valign="top"width="68%"headers="mcps1.1.3.1.2 "><pid="p492mcpsimp"><aname="p492mcpsimp"></a><aname="p492mcpsimp"></a>Obtains the key of the <strongid="b1679393910314"><aname="b1679393910314"></a><aname="b1679393910314"></a>SurfaceBuffer</strong> object.</p>
<tdclass="cellrowborder"valign="top"width="68%"headers="mcps1.1.3.1.2 "><pid="p497mcpsimp"><aname="p497mcpsimp"></a><aname="p497mcpsimp"></a>Obtains the virtual address of the <strongid="b56714253110"><aname="b56714253110"></a><aname="b56714253110"></a>SurfaceBuffer</strong> object.</p>
<tdclass="cellrowborder"valign="top"width="68%"headers="mcps1.1.3.1.2 "><pid="p502mcpsimp"><aname="p502mcpsimp"></a><aname="p502mcpsimp"></a>Obtains the size of the <strongid="b12547184533112"><aname="b12547184533112"></a><aname="b12547184533112"></a>SurfaceBuffer</strong> object.</p>
<tdclass="cellrowborder"valign="top"width="68%"headers="mcps1.1.3.1.2 "><pid="p507mcpsimp"><aname="p507mcpsimp"></a><aname="p507mcpsimp"></a>Sets the 32-bit integer for the <strongid="b284244873112"><aname="b284244873112"></a><aname="b284244873112"></a>SurfaceBuffer</strong> object.</p>
<tdclass="cellrowborder"valign="top"width="68%"headers="mcps1.1.3.1.2 "><pid="p512mcpsimp"><aname="p512mcpsimp"></a><aname="p512mcpsimp"></a>Obtains the 32-bit integer for the <strongid="b11398105163116"><aname="b11398105163116"></a><aname="b11398105163116"></a>SurfaceBuffer</strong> object.</p>
<tdclass="cellrowborder"valign="top"width="68%"headers="mcps1.1.3.1.2 "><pid="p517mcpsimp"><aname="p517mcpsimp"></a><aname="p517mcpsimp"></a>Sets the 64-bit integer for the <strongid="b19859155463116"><aname="b19859155463116"></a><aname="b19859155463116"></a>SurfaceBuffer</strong> object.</p>
<tdclass="cellrowborder"valign="top"width="68%"headers="mcps1.1.3.1.2 "><pid="p522mcpsimp"><aname="p522mcpsimp"></a><aname="p522mcpsimp"></a>Obtains the 64-bit integer for the <strongid="b753775763118"><aname="b753775763118"></a><aname="b753775763118"></a>SurfaceBuffer</strong> object.</p>
<tdclass="cellrowborder"valign="top"width="62%"headers="mcps1.1.3.1.2 "><pid="p541mcpsimp"><aname="p541mcpsimp"></a><aname="p541mcpsimp"></a>Obtains the <strongid="b25453472308"><aname="b25453472308"></a><aname="b25453472308"></a>VsyncHelper</strong> object of the current runner.</p>
<tdclass="cellrowborder"valign="top"width="62%"headers="mcps1.1.3.1.2 "><pid="p546mcpsimp"><aname="p546mcpsimp"></a><aname="p546mcpsimp"></a>Constructs a <strongid="b157281123143212"><aname="b157281123143212"></a><aname="b157281123143212"></a>VsyncHelper</strong> object using an <strongid="b1650443412326"><aname="b1650443412326"></a><aname="b1650443412326"></a>EventHandler</strong> object.</p>
<tdclass="cellrowborder"valign="top"width="62%"headers="mcps1.1.3.1.2 "><pid="p551mcpsimp"><aname="p551mcpsimp"></a><aname="p551mcpsimp"></a>Registers a frame callback.</p>
</td>
</tr>
</tbody>
</table>
## Usage<a name="section18359134910422"></a>
### Transferring a Producer Surface<a name="section193464304411"></a>