Package ilcd
Class Control

Public Method setGraphicAlignment

static void setGraphicAlignment(int mode, int width, int height)

Throws:

_INSERT_METHOD_SIGNATURE_HERE_

Description:

Parameter Range Description
mode Bits 0 ... 3 and 7 alignment properties
width 0 ... display width (0 = full display) width of the alignment area
height 0 ... display height (0 = full display) height of the alignment area

Define an area in which the next graphic will be aligned when subsequently sending the method Graphic.displayLocalGraphic(int) or Graphic.displayGraphicArea(int, int, int, int, int) as well as Graphic.loadAnimatedGraphics(int, int), Graphic.setAnimationCoordinatesToXY(int, int, int) or Graphic.setAnimationCoordinatesToCursorPosition(int).

mode
GRAPHIC_CENTER_HORIZONTALLY
GRAPHIC_CENTER_VERTICALLY
GRAPHIC_RIGHT_JUSTIFY
GRAPHIC_BOTTOM_JUSTIFY
GRAPHIC_TURN_ALIGNMENT_ON

Note

Example

Control.setGraphicAlignment(Control.GRAPHIC_CENTER_HORIZONTALLY |
                           Control.GRAPHIC_CENTER_VERTICALLY |
                           Control.GRAPHIC_TURN_ALIGNMENT_ON,
                           100, 200);

This will set graphic alignment to center the next drawn graphic or loaded animation horizontally and vertically in an area of 100 pixels width and 200 pixels height. To place a graphic into the centre of the display use the following command:

Control.setGraphicAlignment(Control.GRAPHIC_CENTER_HORIZONTALLY |
                           Control.GRAPHIC_CENTER_VERTICALLY |
                           Control.GRAPHIC_TURN_ALIGNMENT_ON,
                           Control.getDisplaySize().getWidth(),
                           Control.getDisplaySize().getHeight());

See also:

Graphic.displayLocalGraphic(int)
Graphic.loadAnimatedGraphics(int, int)
Graphic.displayGraphicArea(int, int, int, int, int)
Graphic.setAnimationCoordinatesToXY(int, int, int)
Graphic.setAnimationCoordinatesToCursorPosition(int)