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 ...
随机推荐
- Java中的static关键字的用法
1.静态方法 static:通常在一个类中定义一个方法为static,那就是说,无需本类的对象即可调用此方法 声明为static的方法有以下几条限制: (1)它们仅能调用其他的static方法. (2 ...
- NodeJS写日志_Log4js使用详解
今天和大家分享一下NodeJS中写日志的一个常用第三方包:Log4js. 跟随主流Blog特色,先简单介绍下Log4js的基本信息.介绍Log4js之前,需要先说一下Log4***,Log4***是由 ...
- cocos2dx 3.x ccDrawLine一个坑
ccDrawLine,如果传进去的坐标是INFINITY,画不出来.
- Android开发11——手机横屏和竖屏与android:configChanges
目前大多数手机都支持重力感应随之而来的就是屏幕方向改变的问题.对应普通开发者来说屏幕的随意改变也会带来困扰.在Google自带的doc里可以看到,如果设备的配置(Resources.Configura ...
- vmware esxi 过期,激活
首先我们打开vSphere Client,登录esxi主机 他会提示你,说你的esxi主机的评估期还剩多长时间 我们现在去激活,我们下载esxi的注册机 然后点击配置--->已获许可的功能--- ...
- 使用.net的跟踪诊断来记录wcf消息
首先在项目的config文件中定义以下结点: <system.diagnostics> <sources> <source name="System.Servi ...
- HDU 2256 Problem of Precision(矩阵高速幂)
题目地址:HDU 2256 思路: (sqrt(2)+sqrt(3))^2*n=(5+2*sqrt(6))^n; 这时要注意到(5+2*sqrt(6))^n总能够表示成an+bn*sqrt(6); a ...
- Hadoop自学笔记(五)配置分布式Hadoop环境
上一课讲了怎样在一台机器上建立Hadoop环境.我们仅仅配置了一个NHName Node, 这个Name Node里面包括了我们全部Hadoop的东西.包括Name Node, Secondary N ...
- 用node-inspector调试NodeJS
任何一门完备的语言技术栈都少不了健壮的调试工具,对于NodeJS平台同样如此,笔者研究了几种调试NodeJS代码的方式,通过对比,还是觉得node-inspector的调试方式比较方便,而且和前端Ja ...
- .net+jquery+ashx实现客户端模拟登陆扩展
客户端实现:login namespace LoginApp { partial class Form1 { /// <summary> /// 必需的设计器变量. /// </su ...