其他分享
首页 > 其他分享> > Graphics2D画一个自定义背景颜色的背景

Graphics2D画一个自定义背景颜色的背景

作者:互联网

  1. int width=256;
  2.   int height=256;
  3.   //创建BufferedImage对象 定义长宽及背景图
  4. BufferedImage bi =  new BufferedImage(1039,479,BufferedImage.TYPE_INT_RGB);    

    Graphics2D graphics = originImage.createGraphics();

    //设置背景颜色
    graphics.setPaint (bgColor);

    覆盖背景
    graphics.fillRect ( 0, 0, 1039, 479);

     

标签:Graphics2D,自定义,int,背景,BufferedImage,1039,graphics,256
来源: https://www.cnblogs.com/xiao1993/p/15183510.html