// See e575 The Quintessential Drawing Program
public void paint(Graphics g) {
// Retrieve the graphics context; this object is used to paint shapes
Graphics2D g2d = (Graphics2D)g; // Determine if antialiasing is enabled
RenderingHints rhints = g2d.getRenderingHints();
boolean antialiasOn = rhints.containsValue(RenderingHints.VALUE_ANTIALIAS_ON); // Enable antialiasing for shapes
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON); // Disable antialiasing for shapes
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_OFF); // Draw shapes...; see e586 Drawing Simple Shapes // Enable antialiasing for text
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON); // Draw text...; see e591 Drawing Simple Text // Disable antialiasing for text
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
}
Related Examples

e577. Enabling Antialiasing的更多相关文章

  1. SQL Server 2012安装错误案例:Error while enabling Windows feature: NetFx3, Error Code: -2146498298

    案例环境: 服务器环境 :    Windows Server 2012 R2 Standard 数据库版本 :    SQL Server 2012 SP1 案例介绍:   在Windows Ser ...

  2. OpenFlow:Enabling Innovation in Campus Networks

    SDN领域,OpenFLow现在已经成为了广泛使用的南向接口协议.若想好好学习SDN,在这个领域有所进步,需要熟悉OpenFlow协议.我最近找了篇有关OpenFLow的论文,发现最早该协议是在Sig ...

  3. win8.1中安装sql2014 0x800F0906 【 Error while enabling Windows feature : NetFx3, Error Code : -2146498298 】

    安装sql2012 需要安装net3.5  没有的话 安装不成功 Error while enabling Windows feature : NetFx3, Error Code : -214649 ...

  4. Zyxel Switch-How to block a fake DHCP server without enabling DHCP snooping?

    How to block a fake DHCP server without enabling DHCP snooping? Scenario How to block a fake DHCP se ...

  5. Enabling CORS in WCF

    Introduction This is an intermediate example of WCF as REST based solution and enabling CORS access, ...

  6. Antialiasing with Transparency

    Antialiasing with Transparency This sample demonstrates the GeForce 7 Series per-primitive super-sam ...

  7. Unity3d 超级采样抗锯齿 Super Sampling Anti-Aliasing

    Super Sampling Anti-AliasingSSAA算是在众多抗锯齿算法中比较昂贵的一种了,年代也比较久远,但是方法比较简单,主要概括为两步1.    查找边缘2.    模糊边缘这是一种 ...

  8. Enabling Active Directory Authentication for VMWare Server running on Linux《转载》

    Enabling Active Directory Authentication for VMWare Server running on Linux Version 0.2 - Adam Breid ...

  9. 14.8.1 Enabling File Formats

    14.8 InnoDB File-Format Management 14.8.1 Enabling File Formats 14.8.2 Verifying File Format Compati ...

随机推荐

  1. 歌词字幕转换制作专家转换LRC-UTF,出错问题,乱码问题,格式问题

    我使用歌词字幕转换制作专家把LRC字幕格式转换成UTF格式后竟然是乱码,求助怎么解决. 编码问题... 转换之前,要先把它处理成ANSI码.先用记事本打开lrc,然后文件-> 另存为,在对话框下 ...

  2. python pandas 计算相关系数

    pandas 中df 对象自带相关性计算方法corr() , 可以用来计算DataFrame对象中所有列之间的相关系数(包括pearson相关系数.Kendall Tau相关系数和spearman秩相 ...

  3. ES6 class setTimeout promise async/await 测试Demo

    class Person { async getVersion () { return new Promise((resolve, reject) => { setTimeout(functio ...

  4. php 数组与数组 的交集和差集

    注意,必须是第一个参数的数组的长度比较长才可以使用 $a1=array("0","1","2","3"); $a2=ar ...

  5. mysqlbackup 重建带有gtid特性的slave

    一.mysqlbackup简介: mysqlbackup是mysql的一个企业级备份工具,优点就是牛逼,缺点就是这东西要钱买. 二.gtid 特性简介: gtid 的中文名叫全局事务ID,也就是说每一 ...

  6. 从github上下载项目到eclipse

    第一步:把代码下载到本地的仓库中 到github后选择自己想下载的项目,拷贝它的URL,图示如下: 进入eclipse中  点击后如下:  继续 按照图片指示继续(大白菜next教程)     fin ...

  7. 写个关于使用cocostudio Armature实现动画自由切换的小demo

    这是一个关于使用cocostudio实现动画自由切换的小demo auto sprite =Sprite::create("background.png"); sprite-> ...

  8. 一些常见的关于Linux系统的问题

    1 如何看当前Linux系统有几颗物理CPU和每颗CPU的核数? 答:[root@centos6 ~ 10:55 #35]# cat /proc/cpuinfo|grep -c 'physical i ...

  9. jQuery.extend()中的布尔值的作用

    jQuery.extend()中,第一个参数可以添加一个布尔值,表示是否深层拷贝,默认是false.但如果设置为true,则表示深层拷贝. 下面来看看什么是深层拷贝: <script type= ...

  10. hbase RowFilter如何根据rowkey查询以及实例实现代码 habase模糊查询【转】

    RowFilter用于过滤row key Operator Description LESS 小于 LESS_OR_EQUAL 小于等于 [EQUAL 等于 NOT_EQUAL 不等于 GREATER ...