public class PixelPngDrawer extends Object
created in 2020/11/18
| 限定符和类型 | 字段和说明 |
|---|---|
private Graphics2D |
g2
绘图对象
|
private BufferedImage |
image
绘制图片对象
|
private Color[] |
mappingColor
绘制像素颜色映射数组
|
private int |
num
写到第几个像素
|
private int |
pointXEnd
像素X尾部
|
private int |
pointXStart
绘制区域高度
|
private int |
pointYEnd
像素Y尾部
|
private int |
pointYStart
像素Y起始
|
private int |
pxSideHeight
像素高度
|
private int |
pxSideWidth
像素宽度
|
private int |
x
当前绘制 x坐标
|
private int |
y
当前绘制 y 坐标
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
PixelPngDrawer(BdmpGeneInfo bdmpGeneInfo) |
| 限定符和类型 | 方法和说明 |
|---|---|
private void |
doDrawer(int[] clr)
绘制像素
|
private void |
doDrawPixel(Color color)
绘制像素
|
protected void |
drawBackground()
绘制背景
|
protected void |
drawContent(BdmpGeneInfo bdmpGeneInfo)
绘制图片内容
|
private void |
drawer(byte[] b)
将 byte 数组绘制到图片上
|
private void |
drawer(byte[] b,
int len)
将 byte 从0开始len长度的数组绘制到图片上
|
protected void |
drawerPosition()
绘制背景, 以及定位区,
定位区为黑色白色像素相间交替围成的一个矩形.
|
static BufferedImage |
geneRatePixelPng(BdmpGeneInfo bdmpGeneInfo) |
private void |
pointShift()
绘制像素坐标移动
|
private final int pxSideWidth
private final int pxSideHeight
private final int pointXStart
private final int pointXEnd
private final int pointYStart
private final int pointYEnd
private final Color[] mappingColor
private final Graphics2D g2
private final BufferedImage image
private int x
private int y
private int num
protected PixelPngDrawer(BdmpGeneInfo bdmpGeneInfo)
public static BufferedImage geneRatePixelPng(BdmpGeneInfo bdmpGeneInfo) throws IOException
IOExceptionprotected void drawBackground()
protected void drawerPosition()
protected void drawContent(BdmpGeneInfo bdmpGeneInfo) throws IOException
IOExceptionprivate void drawer(byte[] b)
b - 二进制数组private void drawer(byte[] b,
int len)
b - 二进制数组len - 绘制二进制数组的长度private void doDrawer(int[] clr)
clr - 绘制像素单位private void doDrawPixel(Color color)
color - 像素颜色private void pointShift()
Copyright © 2021. All rights reserved.