There are two ways to fill basic shapes like lines and rectangles. The first is to use specific drawing methods like Graphics.fillOval(). This example uses these methods. The second is to construct a shape and then use Graphics2D.fill() to fill the shape. See the java.awt.geom package for examples that create shapes.

g2d.fillArc(x, y, w, h, startAngle, arcAngle);
g2d.fillOval(x, y, w, h);
g2d.fillRect(x, y, w, h);
g2d.fillRoundRect(x, y, w, h, arcWidth, arcHeight); Polygon polygon = new Polygon();
polygon.addPoint(x, y);
// ...continue adding points
g2d.fillPolygon(polygon);
Related Examples

e587. Filling Basic Shapes的更多相关文章

  1. rviz学习笔记(一)——Markers: Sending Basic Shapes (C++) 发送基础形状

    一.创建一个包——进行marker练习 1.创建ROS工作空间和包 mkdir -p ~/catkin_ws/src #创建工作空间目录 #创建ROS数据包 catkin_create_pkg usi ...

  2. e586. Drawing Simple Shapes

    There are two ways to draw basic shapes like circles, ovals, lines, arcs, squares, rectangles, round ...

  3. Computer Graphics Research Software

    Computer Graphics Research Software Helping you avoid re-inventing the wheel since 2009! Last update ...

  4. CG&CAD resource

    Computational Geometry The Geometry Center (UIUC) Computational Geometry Pages (UIUC) Geometry in Ac ...

  5. Gazebo機器人仿真學習探索筆記(三)機器人模型

    gazebo_models:https://bitbucket.org/osrf/gazebo_models 模型庫下載,可以參考如下命令: ~/Rob_Soft/Gazebo7$ hg clone ...

  6. <转>卷积神经网络是如何学习到平移不变的特征

    After some thought, I do not believe that pooling operations are responsible for the translation inv ...

  7. [转]"Windows Phone 7程序设计”完全版电子书可以免费下载了

    本文转自:http://www.cnblogs.com/salam/archive/2010/10/29/1864246.html 现在学习Windows Phone 7开发资料十分有限,除了MSDN ...

  8. CSS绘制简单图形

    究竟该用字体图标.图片图标.还是CSS画一个图标?我也不知道.各有千秋吧.本文将介绍如何用css绘制简单的图形,所有测试在chrome58.0完成,如果你不能得到正确结果请到caniuse查一查看看是 ...

  9. geoserver 图层样式

    1.Styled Layer Descriptor 标准描述了稳当的结构合使用规则.一个文档包含了符号定义和绘制规则,那么这个文档就叫做Styled Layer Desciptor(SLD)样式,它是 ...

随机推荐

  1. 查准与召回(Precision & Recall)

    Precision & Recall 先看下面这张图来理解了,后面再具体分析.下面用P代表Precision,R代表Recall 通俗的讲,Precision 就是检索出来的条目中(比如网页) ...

  2. javascript基础拾遗(七)

    1.对象的继承__proto__ var Language = { name: 'program', score: 8.0, popular: function () { return this.sc ...

  3. iOS开发-Tom猫

    // //  ViewController.m //  20-tom猫 // //  Created by hongqiangli on 2017/8/1. //  Copyright © 李洪强. ...

  4. Java 编程下简介 Class 与类加载

    即使有一个类并对它一无所知,但其实它本身就包含了许多信息,Java 在需要使用到某个类时才会将类加载,并在 JVM 中以一个 java.lang.Class 的实例存在.从 Calss 实例开始,可以 ...

  5. 【转】(六)unity4.6Ugui中文教程文档-------概要-UGUI Animation Integration

    原创至上,移步请戳:(六)unity4.6Ugui中文教程文档-------概要-UGUI Animation Integration 5.Animation Integration(动画集成) 动画 ...

  6. hive的join查询

    hive的join查询 语法 join_table: table_reference [INNER] JOIN table_factor [join_condition] | table_refere ...

  7. ss安装

    安装很简单,如下: apt-get install python-pip pip install shadowsocks 配置文件格式如下: { "server":"0. ...

  8. 进入Linux救援(rescue)模式的四大法门

    原文:http://blog.51cto.com/xxrenzhe/1272838 适用场景: 当误操作修改系统启动文件/etc/fstab, /etc/rc.d/rc.sysinit时,就会造成系统 ...

  9. ios CGRectGet...位置属性的基本介绍

    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 110, 150)]; label.backgroundColor ...

  10. [转]使用Navicat导入导出数据库表

    原文地址:https://blog.csdn.net/anselandevil/article/details/81667199 步骤1:数据中原始数据如下: 点击表,右键选择导出向导,选择导出为sq ...