public class MonochromeCanvas extends Object
https://github.com/adafruit/Adafruit-GFX-Library
Modifier and Type | Class and Description |
---|---|
static class |
MonochromeCanvas.Color |
Constructor and Description |
---|
MonochromeCanvas(int width,
int height) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
drawBitmap(int x,
int y,
byte[][] bitmap,
boolean opaque)
Draws a bitmap.
|
void |
drawChar(int x,
int y,
char c,
MonochromeCanvas.Color color,
MonochromeCanvas.Color bg,
int size) |
void |
drawCircle(int centerX,
int centerY,
int r) |
void |
drawCircle(int centerX,
int centerY,
int r,
MonochromeCanvas.Color color) |
void |
drawCircleHelper(int centerX,
int centerY,
int r,
int cornername,
MonochromeCanvas.Color color) |
void |
drawHorizontalLine(int x,
int y,
int w,
MonochromeCanvas.Color color) |
void |
drawImage(int x,
int y,
BufferedImage image,
boolean opaque,
boolean invert)
Draws an image.
|
void |
drawLine(int fromX,
int fromY,
int toX,
int toY) |
void |
drawLine(int fromX,
int fromY,
int toX,
int toY,
MonochromeCanvas.Color color) |
void |
drawRect(int x,
int y,
int w,
int h) |
void |
drawRect(int x,
int y,
int w,
int h,
MonochromeCanvas.Color color) |
void |
drawRoundRect(int x,
int y,
int w,
int h,
int r,
MonochromeCanvas.Color color) |
void |
drawString(int x,
int y,
String s) |
void |
drawTriangle(int x0,
int y0,
int x1,
int y1,
int x2,
int y2,
MonochromeCanvas.Color color) |
void |
drawVerticalLine(int x,
int y,
int h,
MonochromeCanvas.Color color) |
void |
fillCircle(int x,
int y,
int r,
MonochromeCanvas.Color color) |
void |
fillCircleHelper(int centerX,
int centerY,
int r,
int cornername,
int delta,
MonochromeCanvas.Color color) |
void |
fillRect(int x,
int y,
int w,
int h) |
void |
fillRect(int x,
int y,
int w,
int h,
MonochromeCanvas.Color color) |
void |
fillRoundRect(int x,
int y,
int w,
int h,
int r,
MonochromeCanvas.Color color) |
void |
fillScreen(MonochromeCanvas.Color color) |
void |
fillTriangle(int x0,
int y0,
int x1,
int y1,
int x2,
int y2,
MonochromeCanvas.Color color) |
MonochromeCanvas.Color |
getBackgroundColor() |
byte[] |
getBuffer() |
MonochromeCanvas.Color |
getColor() |
int |
getCursorX() |
int |
getCursorY() |
int |
getHeight() |
int |
getRotation() |
Rectangle |
getTextBounds(String str,
int x,
int y) |
int |
getTextsize() |
int |
getWidth() |
void |
setBackgroundColor(MonochromeCanvas.Color bgcolor) |
void |
setColor(MonochromeCanvas.Color textcolor) |
void |
setCursor(int x,
int y) |
void |
setPixel(int x,
int y,
MonochromeCanvas.Color color) |
void |
setRotation(int rotation) |
void |
setTextsize(int textsize) |
void |
setWordWrap(boolean wrap) |
void |
write(char c) |
void |
write(String s) |
public void setPixel(int x, int y, MonochromeCanvas.Color color)
public void drawLine(int fromX, int fromY, int toX, int toY, MonochromeCanvas.Color color)
public void drawLine(int fromX, int fromY, int toX, int toY)
public void drawVerticalLine(int x, int y, int h, MonochromeCanvas.Color color)
public void drawHorizontalLine(int x, int y, int w, MonochromeCanvas.Color color)
public void drawRect(int x, int y, int w, int h, MonochromeCanvas.Color color)
public void drawRect(int x, int y, int w, int h)
public void fillRect(int x, int y, int w, int h, MonochromeCanvas.Color color)
public void fillRect(int x, int y, int w, int h)
public void fillScreen(MonochromeCanvas.Color color)
public void drawCircle(int centerX, int centerY, int r, MonochromeCanvas.Color color)
public void drawCircle(int centerX, int centerY, int r)
public void drawCircleHelper(int centerX, int centerY, int r, int cornername, MonochromeCanvas.Color color)
public void fillCircle(int x, int y, int r, MonochromeCanvas.Color color)
public void fillCircleHelper(int centerX, int centerY, int r, int cornername, int delta, MonochromeCanvas.Color color)
public void drawRoundRect(int x, int y, int w, int h, int r, MonochromeCanvas.Color color)
public void fillRoundRect(int x, int y, int w, int h, int r, MonochromeCanvas.Color color)
public void drawTriangle(int x0, int y0, int x1, int y1, int x2, int y2, MonochromeCanvas.Color color)
public void fillTriangle(int x0, int y0, int x1, int y1, int x2, int y2, MonochromeCanvas.Color color)
public void drawChar(int x, int y, char c, MonochromeCanvas.Color color, MonochromeCanvas.Color bg, int size)
public void drawString(int x, int y, String s)
public void write(char c)
public void write(String s)
public void drawBitmap(int x, int y, byte[][] bitmap, boolean opaque)
x
- y
- bitmap
- data to display. Each bit stands for a pixel.opaque
- if true, 0 - bits is drawn in background color, if false -
the color of corresponding pixel doesn't changepublic void drawImage(int x, int y, BufferedImage image, boolean opaque, boolean invert)
x
- y
- image
- an image to drawopaque
- if true, 0 - bits is drawn in background color, if false -
the color of corresponding pixel doesn't changeinvert
- true to make dark pixels of the image be drawn as bright
pixels on screenpublic void clear()
public int getRotation()
public void setRotation(int rotation)
public MonochromeCanvas.Color getColor()
public void setColor(MonochromeCanvas.Color textcolor)
public MonochromeCanvas.Color getBackgroundColor()
public void setBackgroundColor(MonochromeCanvas.Color bgcolor)
public int getTextsize()
public void setTextsize(int textsize)
public void setWordWrap(boolean wrap)
public void setCursor(int x, int y)
public int getCursorX()
public int getCursorY()
public byte[] getBuffer()
public int getWidth()
public int getHeight()
Copyright © 2017. All rights reserved.