zoukankan      html  css  js  c++  java
  • Graphics samples2

    为图形填充渐变色:

    Graphics2D g2=(Graphics2D)g;

    GradientPaint gra=new GradientPaint(20, 20, Color.BLUE, 100,80,Color.cyan,true);

    g2.setPaint(gra);

    g2.fillRect(50, 50, 150, 150);

    平移坐标轴:

    g2.translate(10,100);

    创建椭圆对象:

    Ellipse2D.Float ellipse=new Ellipse2D.Float(-80,5,160,10);

    图形的加减运算:

    Ellipse2D.Float ellipse=new Ellipse2D.Float(20,20,160,160);
    Ellipse2D.Float ellip=new Ellipse2D.Float(90,20,160,160);
    Area area=new Area(ellipse);
    Area are=new Area(ellip);
    area.subtract(are);
    g2.fill(area);

    加运算是add();

    交运算是intersect();

    yihuoyunsuanshi:exclusiveOr();

  • 相关阅读:
    4月24日 PHP基础
    4月22日 常用函数
    4月22日 练习题
    PHP正则数组
    PHP基础函数应用
    数据库SQL语句
    高级查询
    mysql
    CSS样式表
    词汇
  • 原文地址:https://www.cnblogs.com/mafeng/p/4457365.html
Copyright © 2011-2022 走看看