用Graphics2D配合BufferedImage绘制与输出一个饼状图
链接: 参考https://www.jianshu.com/p/97e3f0a08c6c.
graphics2d api整理(列举一些经常使用的)
画板画笔设置
/**
* 创建画板
*/
public Graphics2D createGraphics();
/**
* 渲染效果配置
*/
public abstract void setRenderingHint(Key hintKey, Object hintValue);
/**
* 设置画笔颜色
*/
public abstract void setPaint( Paint paint );
/**
* 设置文字样式
*/
public abstract void setFont(Font font);
画图
/**
* 往画板上填充图片,observer一般设置为null
*/
public abstract boolean drawImage(Image img, int x, int y,
ImageObserver observer);
/**
* 往画板上写字
*/
public abstract void drawString(String str, int x, int y);
/**
* 画矩形
*/
public void drawRect(int x, int y, int width, int height);
/**