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 ...
随机推荐
- ejabberd常见配置说明
1.数据库配置 ejabberd默认安装后使用的是自带的数据库,可以通过配置使用其他的数据库如Mysql.Sqlserver.Postgresql等数据库,Mysql数据库配置参见<Linux下 ...
- Linux 下子线程 exit code 在主线程中的使用
Linux线程函数原型是这样的: void* thread_fun(void* arg) 它的返回值是 空类型指针,入口参数也是 空类型指针.那么线程的 exit code 也应该是 void * 类 ...
- HDU 3667 费用流(拆边)
题意:有n个城市(1~n),m条有向边:有k件货物要从1运到n,每条边最多能运c件货物,每条边有一个危险系数ai,经过这条路的费用需要ai*x2(x为货物的数量),问所有货物安全到达的费用. 思路:c ...
- AC日记——codevs 1086 栈 (卡特兰数)
题目描述 Description 栈是计算机中经典的数据结构,简单的说,栈就是限制在一端进行插入删除操作的线性表. 栈有两种最重要的操作,即pop(从栈顶弹出一个元素)和push(将一个元素进栈). ...
- HTTP请求与响应方式
HTTP请求格式 当浏览器向Web服务器发出请求时,它向服务器传递了一个数据块,也就是请求信息,HTTP请求信息由3部分组成: l 请求方法URI协议/版本 l 请求头(Request Hea ...
- maven总结4
仓库.nexus 构件:在maven中,任何一个依赖(jar包).插件(maven-compiler-plugin-2.5.1.jar)或者项目输出(前面例子中运行mvn clean install ...
- java 12-5 StringBuffer的几个案例
1. 把数组拼接成一个字符串 public class StringBufferTest2 { public static void main(String[] args) { //定义一个数组 in ...
- Netty指定分隔的字符
package org.zln.netty.five.part02; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; ...
- 19SpringMvc_在业务控制方法中收集List集合中包含JavaBean参数
本文要实现的功能是给一张表单:
- Linux 进程通信(有名管道)
有名管道(FIFO) 有名管道是持久稳定的. 它们存在于文件系统中. FIFO比无名管道作用更大,因为他们能让无关联的进程之间交换数据. 管道文件一般用于交换数据. shell命令创建管道 一个she ...