Graphics samples
绘制二次曲线:
public void paint(Graphics g) {
// TODO 自动生成的方法存根
super.paint(g);
Graphics2D g2=(Graphics2D)g;
QuadCurve2D.Double curle=new QuadCurve2D.Double(60,20,120,100,180,20);
g2.draw(curle);
}
绘制三次曲线:
public void paint(Graphics g) {
// TODO 自动生成的方法存根
super.paint(g);
Graphics2D g2=(Graphics2D)g;
QuadCurve2D.Double curle=new QuadCurve2D.Double(60,20,120,100,180,20);
g2.draw(curle);
}
绘制文本:
public void paint(Graphics g) {
// TODO 自动生成的方法存根
super.paint(g);
String str=new String("静夜思");
int x=50;
int y=50;
g.drawString(str, x, y);
}
设置文本字体:
Font font=new Font(TOOL_TIP_TEXT_KEY, Font.BOLD, 26);
g.setFont(font);
设置文本颜色:
Font font=new Font(TOOL_TIP_TEXT_KEY, Font.BOLD, 26);
g.setFont(font);
设置笔画的粗细:
Graphics2D g2=(Graphics2D)g;
Stroke st=new BasicStroke(20);
g2.setStroke(st);
g2.drawLine(0, 0, 200, 200);
设置笔画样式及连接方式:
Stroke st=new BasicStroke(20,BasicStroke.JOIN_ROUND,BasicStroke.JOIN_BEVEL);
g2.setStroke(st);
设置虚线模式:
float[] arr={10.0f,10.0f};
Stroke st=new BasicStroke(2,BasicStroke.JOIN_ROUND,BasicStroke.JOIN_BEVEL,1.0f, arr,0);
g2.setStroke(st);
Graphics samples的更多相关文章
- Vulkan SDK Demo 之一 熟悉
DiligentEngine的API是D3d11和D3D12风格的,vulkan也被封装成了这种风格的API. 在了解Diligent Engine是如何对vulkan进行封装之前,我准备先学习下Vu ...
- Vulkan 开发学习资料汇总
开发资料汇总 1.API Reference 2.Vulkan Spec 有详细说明的pdf 文章 1.知乎Vulkan-高性能渲染 2.Life of a triangle - NVIDIA's l ...
- A trip through the Graphics Pipeline 2011_13 Compute Shaders, UAV, atomic, structured buffer
Welcome back to what’s going to be the last “official” part of this series – I’ll do more GPU-relate ...
- A trip through the Graphics Pipeline 2011_08_Pixel processing – “fork phase”
In this part, I’ll be dealing with the first half of pixel processing: dispatch and actual pixel sha ...
- A trip through the Graphics Pipeline 2011_07_Z/Stencil processing, 3 different ways
In this installment, I’ll be talking about the (early) Z pipeline and how it interacts with rasteriz ...
- A trip through the Graphics Pipeline 2011_04
Welcome back. Last part was about vertex shaders, with some coverage of GPU shader units in general. ...
- A trip through the Graphics Pipeline 2011_02
Welcome back. Last part was about vertex shaders, with some coverage of GPU shader units in general. ...
- [ZZ] Understanding 3D rendering step by step with 3DMark11 - BeHardware >> Graphics cards
http://www.behardware.com/art/lire/845/ --> Understanding 3D rendering step by step with 3DMark11 ...
- CUDA samples 第三章 sample reference 概况
示例代码分为下列几类: 1. Simple Reference 基础CUDA示例,适用于初学者, 反应了运用CUDA和CUDA runtime APIs的一些基本概念. 2. Utilitie ...
随机推荐
- Linux shell basic3 dd wc comm chmod ls
Generating files of any size /dev/zerois a character special device, which infinitely returns the ze ...
- TestNG之执行测试类方式
TestNG提供了很多执行方式,下面做简单介绍. 1.XML指明测试类,按照类名执行,其中可以指定包名,也可指定无包名: 带包名,运行ParameterSample类和ParameterTest类 & ...
- HDU 4419 Colourful Rectangle --离散化+线段树扫描线
题意: 有三种颜色的矩形n个,不同颜色的矩形重叠会生成不同的颜色,总共有R,G,B,RG,RB,GB,RGB 7种颜色,问7种颜色每种颜色的面积. 解法: 很容易想到线段树扫描线求矩形面积并,但是如何 ...
- Unity-WIKI 之 DrawArrow
组件作用 Unity画方向箭头类库,在Scene视图或在Game视图打开Gizmos查看效果 效果预览 wiki地址 http://wiki.unity3d.com/index.php/DrawA ...
- java 16-2 ArrayList的练习2
需求:去除集合中自定义对象的重复值(对象的成员变量值都相同 注意: 我们按照和字符串一样的操作,发现出问题了. 为什么呢? 我们必须思考哪里会出问题? 通过简单的分析,我们知道问题出现在了判断上. ...
- [转] 腾讯云直播OBS推流教程
from: http://www.jianshu.com/p/bf4066028882 腾讯云直播OBS推流教程 字数383 阅读55 评论3 喜欢0 1.安装OBS 进入obs 官网 : https ...
- android app多渠道分发打包
1. 美团多渠道包的方法论 1) maven编译多次 2) apktool一次包,解开重新打 (个人倾向于这个) 3) http://tech.meituan.com/mt-apk-packagi ...
- request模块提交数据
http://ctf8.shiyanbar.com/jia/ #coding:utf-8import re,requestsurl = r"http://ctf8.shiyanbar.com ...
- ABP入门系列(5)——创建应用服务
一.解释下应用服务层 应用服务用于将领域(业务)逻辑暴露给展现层.展现层通过传入DTO(数据传输对象)参数来调用应用服务,而应用服务通过领域对象来执行相应的业务逻辑并且将DTO返回给展现层.因此,展现 ...
- ASP.NET 里的 JSON操作
最近项目中需要用到 JSON操作,google了一下 找到了几个比较好的操作方法.... 一 .使用 mircosoft 提供的 .NET Framework 自带的 json操作方法 1. 使用Ja ...