国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

實現陰影、鏤空、離散等特種文字效果

2019-11-18 13:24:34
字體:
來源:轉載
供稿:網友

  如何實現陰影、鏤空、離散等特種文字效果?
  
   下面是從http://www.javaworld.com/javaworld/javatips/jw-javatip81.Html 得到
   的一些實現特種文字效果的代碼片斷。感愛好的網友可以自己去看原文。
  
   // Shadow
   g.setColor(new Color(50, 50, 50));
   g.drawString("Shadow", ShiftEast(x, 2), ShiftSouth(y, 2));
   g.setColor(new Color(220, 220, 220));
   g.drawString("Shadow", x, y);
  
   // Engrave
   g.setColor(new Color(220, 220, 220));
   g.drawString("Engrave", ShiftEast(x, 1), ShiftSouth(y, 1));
   g.setColor(new Color(50, 50, 50));
   g.drawString("Engrave", x, y);
  
   file://Outline
   g.setColor(Color.red);
   g.drawString("Outline", ShiftWest(x, 1), ShiftNorth(y, 1));
   g.drawString("Outline", ShiftWest(x, 1), ShiftSouth(y, 1));
   g.drawString("Outline", ShiftEast(x, 1), ShiftNorth(y, 1));
   g.drawString("Outline", ShiftEast(x, 1), ShiftSouth(y, 1));
   g.setColor(Color.yellow);
   g.drawString("Outline", x, y);
  
   file://Hollow
   g.setColor(Color.black);
   g.drawString("Hollow", ShiftWest(x, 1), ShiftNorth(y, 1));
   g.drawString("Hollow", ShiftWest(x, 1), ShiftSouth(y, 1));
   g.drawString("Hollow", ShiftEast(x, 1), ShiftNorth(y, 1));
   g.drawString("Hollow", ShiftEast(x, 1), ShiftSouth(y, 1));
   g.setColor(bg);
   g.drawString("Hollow", x, y);
  
   file://Segment
   int w = (g.getFontMetrics()).stringWidth("Segment");
   int h = (g.getFontMetrics()).getHeight();
   int d = (g.getFontMetrics()).getDescent();
   g.setColor(new Color(220, 220, 220));
   g.drawString("Segment", x, y);
   g.setColor(bg);
   for (int i = 0; i < h; i += 3)
   g.drawLine(x, y + d - i, x + w, y + d - i);
  
   file://3D Effects
   Color top_color = new Color(200, 200, 0);
   Color side_color = new Color(100, 100, 0);
   for (int i = 0; i < 5; i++)
   {
   g.setColor(top_color);
   g.drawString("3-Dimension", ShiftEast(x, i), ShiftNorth(ShiftSouth(y, i), 1));
   g.setColor(side_color);
   g.drawString("3-Dimension", ShiftWest(ShiftEast(x, i), 1), ShiftSouth(y, ii));
   }
   g.setColor(Color.yellow);
   g.drawString("3-Dimension", ShiftEast(x, 5), ShiftSouth(y, 5));
  
   file://Motion
   for (int i = 0; i < 20; i++)
   {
   font_size = 12 + i;
   g.setFont(new Font("TimesRoman", Font.PLAIN, font_size));
   w = (g.getFontMetrics()).stringWidth("Motion");
   g.setColor(new Color(0, 65 + i * 10, 0));
   g.drawString("Motion", (width - w) / 2, ShiftSouth(y, speed * i));
   }

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 嘉禾县| 鹿泉市| 安溪县| 雅安市| 五河县| 岳池县| 柯坪县| 台东县| 板桥市| 西乌| 肇庆市| 蓬莱市| 仙居县| 霸州市| 旬邑县| 寻乌县| 贵溪市| 两当县| 烟台市| 华坪县| 巴南区| 靖江市| 贺州市| 石柱| 铁岭县| 德州市| 凯里市| 青冈县| 仙桃市| 出国| 武义县| 淮南市| 宝应县| 嘉兴市| 稷山县| 斗六市| 建宁县| 百色市| 故城县| 色达县| 铅山县|