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. PHP网站环境搭配: Apache Http+PHP+Mysql

    Apache Http+PHP+Mysql 环境搭配 1. 先下载上述三个软件 都要下载对应系统的软件,mysql还可以再下载navicat for mysql. 2.  安装Apache Http ...

  2. Python2.7 fabric理论学习

    在python中有一个可以实现批量管理服务器的工具:fabric,在本地和远程机器上提供了一些基本的操作,并且可以上传/下载文件.执行sudo等功能. 学习环境:ubuntu 12.10+python ...

  3. 【Android】输入设备配置文件(.idc文件)

    何为idc idc(Input Device Configuration)为输入设备配置文件,它包含设备具体的配置属性,这些属性影响输入设备的行为. 对于touch screen设备,总是需要一个id ...

  4. 【Gtk】feorda下gtk安装详解

    feorda下gtk安装详解   1.yum在线安装gtk 1)pkg-config -version查看pkg-config的版本(本机测试是0.25)    2)安装必要组建:(在root权限下) ...

  5. openfire 发送 接受 注册 广播 好友列表 在线状态

    package cn.zsmy.utils.openfire; import java.io.BufferedReader; import java.io.InputStreamReader; imp ...

  6. js获取iframe中的元素以及在iframe中获取父级的元素(包括iframe中不存在name和id的情况)

      第一种情况:iframe中不存在name和id的方法:(通过contentWindow获取) var iframe = document.getElementsByTagName('iframe' ...

  7. poj1753(位运算压缩状态+bfs)

    题意:有个4*4的棋盘,上面摆着黑棋和白旗,b代表黑棋,w代表白棋,现在有一种操作,如果你想要改变某一个棋子的颜色,那么它周围(前后左右)棋子的颜色都会被改变(白变成黑,黑变成白),问你将所有棋子变成 ...

  8. 基于Keepalived实现LVS双主高可用集群

    Reference:  https://mp.weixin.qq.com/s?src=3&timestamp=1512896424&ver=1&signature=L1C7us ...

  9. [转]mybatis如何直接 执行传入的任意sql语句 并按照顺序取出查询的结果集

    原文地址:https://www.cnblogs.com/wuyun-blog/p/5769096.html 需求: 1.直接执行前端传来的任何sql语句,parameterType="St ...

  10. thinkphp前台模版字符串截取

    ThinkPHP\Common\extend.php 中管理前台模版的截取{$vons.title|msubstr=0,26} 原始的代码是无法使用截取支持…. 由于涉及到只有汉字检测最为准确 需要加 ...