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 ...
随机推荐
- 查看Ubuntu版本
一.查看Ubuntu版本号 方法一 root@wiki:~# cat /etc/issue Ubuntu 14.04.1 LTS \n \l 方法二 root@wiki:~# sudo lsb_rel ...
- Visualize real-time data streams with Gnuplot
源文地址 (September 2008) For the last couple of years, I've been working on European Space Agency (ESA) ...
- matlab生成HEX文件-任意信号 大于64K长度
HEX文件格式不赘述,写里直接放上代码.请批评改正. %%convert a signal data into hex file format % data format:16bit % signal ...
- java lambda小纪
一个通俗的说法是 :C#委托和Java中实现了 函数式编程的方法,它是函数式编程中的概念,为了更快的处理集合,在Java,c#等静态类型语言中想要引用一个函数的一种方式,(实现了通过封装匿名方法来达到 ...
- 深度优先搜索 codevs 1031 质数环
codevs 1031 质数环 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题目描述 Description 一个大小为N(N<=17)的质数环是 ...
- SPOJ AMR10E Stocks Prediction --二分求和+矩阵快速幂
题意:给一个递推式S(n) = a1*S(n-1)+...+aR*S(n-R),要求S(k)+S(2k)+...+S(nk)的值. 分析:看到n的大小和递推式,容易想到矩阵快速幂.但是如何转化呢? 首 ...
- 安装grunt
1,npm install -g grunt-cli 2,npm install grunt --save 作为项目的依赖安装 这两步必不可少
- 09SpringMvc_再次讲一下SpringMvc的工作流:
整个SpringMvc的流程图:
- 14Spring_AOP编程(AspectJ)_环绕通知
在目标方法执行前后,进行代码增强 (阻止目标方法的执行 ) 环绕通知实现任何通知效果. 案例如下: 案例结构:
- Gitub
1.下载地址(注册:jackchn,jackchn@foxmail.com) http://windows.github.com/ 2.使用 github for Windows使用介绍 搭建一个免费 ...