派生自 projectDept/qhighschool

EricsHu
2023-11-25 79ab2cbd31c022916a8e696903d5eb34b70aa403
src/main/java/com/qxueyou/scc/org/util/CourseMarketUtils.java
@@ -11,7 +11,7 @@
/**
 * 课程超市工具类
 * 课程超市工具类
 * @author xiadehu
 *
 */
@@ -25,7 +25,7 @@
    */
   public static BufferedImage drawPng(char letter,Color bgColor){
      
      //初始化画布
      //初始化画布
      int width=120;
      int height = 120;
      BufferedImage image = new BufferedImage(width, height,     BufferedImage.TYPE_INT_RGB);
@@ -34,7 +34,7 @@
      g2d.dispose();
      g2d = image.createGraphics();
       
      //背景
      //背景
      g2d.setColor(bgColor);
      g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
      double centerX = width/2;
@@ -44,11 +44,11 @@
      circle.setFrameFromCenter(centerX, centerY, centerX + radius, centerY+ radius);
      g2d.fill(circle);
      
      //文字
      //文字
      g2d.setColor(new Color(255,255,255));
      int textSize = 64;
      
      Font font = new Font("微软雅黑", Font.PLAIN, textSize);
      Font font = new Font("微软雅黑", Font.PLAIN, textSize);
      g2d.setFont(font);
      FontMetrics metrics = g2d.getFontMetrics();
      
@@ -57,7 +57,7 @@
      
      g2d.drawString(String.valueOf(letter), x, y);
      
      //释放
      //释放
      g2d.dispose();
      
      return image;