public interface BufferedImageProvider extends UIDrawing, UIImageDrawing
This kind of image is created when a MicroUI extension library offers the possibility to create a custom MicroUI BufferedImage with a specific image format. This image may not hold a pixels buffer.
The Platform's Front Panel project (or a library) has to mention the implementation of this interface in a META-INF
file: [src folder]/META-INF/services/ej.microui.display.BufferedImageProvider:
ej.xxx.XXXProviderwhere
XXXProvider is an implementation of this interface.
A custom buffered image provider is also registered as drawer LLUIDisplay.registerUIDrawer(UIDrawing) and
custom image drawer LLUIDisplay.registerUIImageDrawer(UIImageDrawing).
So it is used to:
newBufferedImage(int, int),UIDrawing, for example
UIDrawing.drawLine(MicroUIGraphicsContext, int, int, int, int)),UIImageDrawing, for example
UIImageDrawing.draw(MicroUIGraphicsContext, ej.microui.display.MicroUIImage, int, int, int, int, int, int, int)),UIImageDrawing.decode(byte[], int, int, int, boolean)).| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
newBufferedImage(int width,
int height)
Creates a new buffered image.
|
drawChar, drawCharWithRotationBilinear, drawCharWithRotationNearestNeighbor, drawCircle, drawCircleArc, drawEllipse, drawEllipseArc, drawFlippedImage, drawHorizontalLine, drawImage, drawLine, drawRectangle, drawRenderableString, drawRotatedImageBilinear, drawRotatedImageNearestNeighbor, drawRoundedRectangle, drawScaledImageBilinear, drawScaledImageNearestNeighbor, drawScaledRenderableStringBilinear, drawScaledStringBilinear, drawString, drawThickCircle, drawThickCircleArc, drawThickEllipse, drawThickFadedCircle, drawThickFadedCircleArc, drawThickFadedEllipse, drawThickFadedLine, drawThickFadedPoint, drawThickLine, drawVerticalLine, fillCircle, fillCircleArc, fillEllipse, fillEllipseArc, fillRectangle, fillRoundedRectangle, handledFormat, initializeRenderableStringSNIContext, stringWidth, writePixeldecode, draw, drawFlipped, drawRotatedBilinear, drawRotatedNearestNeighbor, drawScaledBilinear, drawScaledNearestNeighbor, handledFormatjava.lang.Object newBufferedImage(int width,
int height)
Note that a buffered image is an image which is not managed by the Graphics Engine' software algorithms. The Platform has the responsibility to check if the drawing target is a custom image or not.
The Platform object can be retrieved at runtime by calling Image.getRAWImage():
public void fillRectangle(MicroUIGraphicsContext gc, int x1, int y1, int x2, int y2) {
MyCustomImage customImage = (MyCustomImage) gc.getImage().getRAWImage();
// draw in a custom buffered image
// ...
}
For the custom drawings, the MicroUIGraphicsContext (that targets a custom buffered image) can be used as
a standard graphics context (see LLUIPainter).width - the buffered image widthheight - the buffered image height