e577. Enabling Antialiasing
// 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的更多相关文章
- SQL Server 2012安装错误案例:Error while enabling Windows feature: NetFx3, Error Code: -2146498298
案例环境: 服务器环境 : Windows Server 2012 R2 Standard 数据库版本 : SQL Server 2012 SP1 案例介绍: 在Windows Ser ...
- OpenFlow:Enabling Innovation in Campus Networks
SDN领域,OpenFLow现在已经成为了广泛使用的南向接口协议.若想好好学习SDN,在这个领域有所进步,需要熟悉OpenFlow协议.我最近找了篇有关OpenFLow的论文,发现最早该协议是在Sig ...
- 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 ...
- 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 ...
- Enabling CORS in WCF
Introduction This is an intermediate example of WCF as REST based solution and enabling CORS access, ...
- Antialiasing with Transparency
Antialiasing with Transparency This sample demonstrates the GeForce 7 Series per-primitive super-sam ...
- Unity3d 超级采样抗锯齿 Super Sampling Anti-Aliasing
Super Sampling Anti-AliasingSSAA算是在众多抗锯齿算法中比较昂贵的一种了,年代也比较久远,但是方法比较简单,主要概括为两步1. 查找边缘2. 模糊边缘这是一种 ...
- 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 ...
- 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 ...
随机推荐
- spring 多线程
http://blog.csdn.net/chszs/article/details/8219189 一.ThreadPoolTaskExecutor ThreadPoolTaskExecutor的配 ...
- NET使用NPOI组件将数据导出Excel-通用方法 【推荐】
一.Excel导入及导出问题产生: 从接触.net到现在一直在维护一个DataTable导出到Excel的类,时不时还会维护一个导入类.以下是时不时就会出现的问题: 导出问题: 如果是as ...
- 音频特征提取——pyAudioAnalysis工具包
作者:桂. 时间:2017-05-04 18:31:09 链接:http://www.cnblogs.com/xingshansi/p/6806637.html 前言 语音识别等应用离不开音频特征的 ...
- go系列之数组
数组 数组是同一类型元素的集合.例如,整数集合 5,8,9,79,76 形成一个数组.Go 语言中不允许混合不同类型的元素,例如包含字符串和整数的数组.(译者注:当然,如果是 interface{} ...
- Dubbo 基础介绍
1.学习背景 随着互联网的发展,越来越多的企业每天处理着上亿级的请求,以及每秒几万的并发操作,对于传统的 JavaWeb 工程师是一个巨大的挑战.然而越来越复杂的业务以及数据库设计使得代码变得非常庞大 ...
- WCF教程网址
http://www.cnblogs.com/iamlilinfeng/archive/2012/09/25/2700049.html http://www.cnblogs.com/artech/ar ...
- 关于navigationBar的颜色计算与默认透明度
NavigationBar的默认透明度为85% 颜色叠加计算公式: RGB需要分开计算,以叠加白色背景为例: 原始颜色(217,10,20) 设置透明度85% 计算过程: R=217 + (255-2 ...
- Linux下查看Raid磁盘阵列信息的方法
Linux下查看软.硬raid信息的方法. 软件raid:只能通过Linux系统本身来查看 cat /proc/mdstat 可以看到raid级别,状态等信息. 硬件raid: 最佳的办法是通过已安装 ...
- 可靠的功能測试--Espresso和Dagger2
欢迎Follow我的GitHub, 关注我的CSDN. 可靠的功能測试, 意味着在不论什么时候, 获取的測试结果均同样, 这就须要模拟(Mock)数据. 測试框架能够使用Android推荐的Espre ...
- Java experts blog
https://blogs.oracle.com/poonam/ https://blogs.oracle.com/poonam/entry/updates_to_the_java_troublesh ...