public interface CustomerDisplayDevice extends Device
USBExtSwitchDevice interface provides control over the power state of USB host ports.
This interface allows applications to manage the power on/off state of USB hosts. The USBExtSwitchDevice object is obtained from the POSTerminal:
CustomerDisplayDevice customerDisplayDevice =
(CustomerDisplayDevice) POSTerminal.getInstance().getDevice(POSTerminal.DEVICE_NAME_CUSTOMER_DISPLAY);
The identifier CustomerDisplayDevice is used to specify the device, as defined by the implementation.
Applications require the following permission to access the device:
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears all images displayed on the customer display screen.
|
boolean |
displayImageOnCustomerScreen(Bitmap image)
Displays a Bitmap image on the customer display device.
|
void |
displayImageOnCustomerScreen(boolean isClear,
int x,
int y,
int width,
int height,
Bitmap image)
Displays a Bitmap image on the customer display device starting from the specified coordinates.
|
void |
displayImageOnCustomerScreen(boolean isClear,
int x,
int y,
int width,
int height,
byte[] imageData)
Displays a PNG or JPG image on the customer display device starting from the specified coordinates.
|
boolean |
displayImageOnCustomerScreen(byte[] imageData)
Displays a PNG or JPG image on the customer display device.
|
Size |
getSize()
Get the resolution of the customer display.
|
void |
keepImageOnClose(boolean isKeep)
The secondary screen remains on or off after you call the close method.
|
void |
keepImageOnSleep(boolean isKeep)
The secondary screen remains on or off when the primary screen turns off.
|
cancelRequest, close, getFailCount, getUsageCount, openvoid clear()
throws DeviceException
This method clears the entire content of the secondary (customer) display by filling it with white. It removes all previously drawn images or graphics, ensuring a clean slate for subsequent display operations.
It is recommended to call this method before displaying a new image if you want to avoid visual artifacts from overlapping or residual content.
DeviceException - if the call fails.boolean displayImageOnCustomerScreen(Bitmap image)
throws DeviceException
This method accepts a Bitmap image of any size and renders it on the customer-facing display starting from the top-left corner. No automatic scaling or cropping is applied. If the image size exceeds the screen resolution, the part beyond the screen range will be intercepted and only the part within the screen will be displayed.
image - A Bitmap object representing the image to display.DeviceException - if the call fails.void displayImageOnCustomerScreen(boolean isClear,
int x,
int y,
int width,
int height,
Bitmap image)
throws DeviceException
This method renders a Bitmap image on the customer-facing display starting from the specified (x, y) coordinate point (x is the horizontal axis, y is the vertical axis), drawing to the right and downwards. If the image size exceeds the screen resolution, the part beyond the screen range will be intercepted and only the part within the screen will be displayed.
The width and height parameters define the region of the bitmap to be displayed.
For instance, if the input Bitmap is 200×200 pixels but width=100 and height=100,
only the top-left 100×100 portion of the bitmap will be rendered.
If isClear is true, the customer display is cleared (filled with white) before drawing;
otherwise, the bitmap is drawn over any existing content.
isClear - whether to clear the current content on the customer display before drawing the image.
If true, the screen is cleared to white first; otherwise, the image is overlaid. default value false.x - the horizontal starting coordinate (in pixels) for rendering the image.y - the vertical starting coordinate (in pixels) for rendering the image.width - the width (in pixels) of the bitmap region to display. Only this many pixels from the
left of the source bitmap will be used.height - the height (in pixels) of the bitmap region to display. Only this many pixels from the
top of the source bitmap will be used.image - a Bitmap object representing the image to display.DeviceException - if the call fails.void displayImageOnCustomerScreen(boolean isClear,
int x,
int y,
int width,
int height,
byte[] imageData)
throws DeviceException
This method sends a PNG or JPG image to the customer-facing display. The image will be rendered starting from the specified (x, y) coordinate point (x is the horizontal axis, y is the vertical axis), drawing to the right and downwards. If the image size exceeds the screen resolution, the part beyond the screen range will be intercepted and only the part within the screen will be displayed.
The width and height parameters define the region of the image to be displayed.
For example, if the input image is 200×200 pixels but width=100 and height=100,
only the top-left 100×100 portion of the image will be rendered on the screen.
If isClear is true, any previously displayed content on the customer display will be
cleared (filled with white) before rendering the new image. If false, the new image will be drawn
on top of existing content.
isClear - whether to clear the current content on the customer display before drawing the image.
If true, the screen is cleared to white first; otherwise, the image is overlaid. default value false.x - the horizontal starting coordinate (in pixels) for rendering the image.y - the vertical starting coordinate (in pixels) for rendering the image.width - the width (in pixels) of the image region to display. Only this many pixels from the
left of the source image will be used.height - the height (in pixels) of the image region to display. Only this many pixels from the
top of the source image will be used.imageData - a byte array containing the PNG or JPG image data.DeviceException - if the call fails.boolean displayImageOnCustomerScreen(byte[] imageData)
throws DeviceException
This method sends a PNG or JPG image to the customer-facing display. The image will be rendered starting from the top-left corner of the display, without scaling or cropping. If the image size exceeds the screen resolution, the part beyond the screen range will be intercepted and only the part within the screen will be displayed.
The image should be in PNG or JPG format.imageData - A byte array containing the PNG or JPG image data.DeviceException - if the call fails.Size getSize()
throws DeviceException
DeviceException - if the call fails.void keepImageOnClose(boolean isKeep)
throws DeviceException
isKeep - true,Set the custom screen to stay on after the application exits.otherwise set to false.DeviceException - if the call fails.void keepImageOnSleep(boolean isKeep)
throws DeviceException
isKeep - true,Set the custom screen to stay on after sleep.otherwise set to false.DeviceException - if the call fails.