绘制二次曲线:

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的更多相关文章

  1. Vulkan SDK Demo 之一 熟悉

    DiligentEngine的API是D3d11和D3D12风格的,vulkan也被封装成了这种风格的API. 在了解Diligent Engine是如何对vulkan进行封装之前,我准备先学习下Vu ...

  2. Vulkan 开发学习资料汇总

    开发资料汇总 1.API Reference 2.Vulkan Spec 有详细说明的pdf 文章 1.知乎Vulkan-高性能渲染 2.Life of a triangle - NVIDIA's l ...

  3. 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 ...

  4. 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 ...

  5. 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 ...

  6. 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. ...

  7. 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. ...

  8. [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 ...

  9. CUDA samples 第三章 sample reference 概况

    示例代码分为下列几类: 1.   Simple Reference 基础CUDA示例,适用于初学者, 反应了运用CUDA和CUDA runtime APIs的一些基本概念. 2.   Utilitie ...

随机推荐

  1. Laxcus大数据管理系统2.0(5)- 第二章 数据组织

    第二章 数据组织 在数据的组织结构设计上,Laxcus严格遵循数据和数据描述分离的原则,这个理念与关系数据库完全一致.在此基础上,为了保证大规模数据存取和计算的需要,我们设计了大量新的数据处理技术.同 ...

  2. sql 入门经典(第五版) Ryan Stephens 学习笔记  第四部分:建立复杂的数据库查询/

    第十三章: 在查询表里结合表 1.等值结合 : // 选择 tabla_a 和table_b 中id相等的行,输出 他们的id 和name select table_a.id , table_a.na ...

  3. 集合框架学习笔记<三>

    一些重要的区别 set与list的区别: set是无索引的,list是有索引的: ArrayList与LinkList的区别: 前者是基于数组实现的,后者是基于链表实现的: 两者的使用方法一样,但是在 ...

  4. [转] Linux下防火墙iptables用法规则详及其防火墙配置

    from: http://www.cnblogs.com/yi-meng/p/3213925.html 备注: 排版还不错,建议看以上的链接. iptables规则 规则--顾名思义就是规矩和原则,和 ...

  5. jQuery Ajax 操作函数及deferred对象

    jQuery Ajax 操作函数 jQuery 库拥有完整的 Ajax 兼容套件.其中的函数和方法允许我们在不刷新浏览器的情况下从服务器加载数据. 函数 描述 jQuery.ajax() 执行异步 H ...

  6. 第五章 使用 Bootstrap Typeahead 组件(百度下拉效果)

    推荐链接:http://www.cnblogs.com/haogj/p/3376874.html UnderScore官网:http://underscorejs.org/ 参考文档:http://w ...

  7. Android studio导入eclipse项目混淆打包出错

    将proguard-android.txt复制一份重命名成proguard-rules.pro,且在build.gradle添加 release {             minifyEnabled ...

  8. SilverIight数据绑定实例

    前台Code <DataGrid Name="DataGrid1" AutoGenerateColumns="False" IsReadOnly=&quo ...

  9. 如何免费访问Google?

    访问Google方法(以Mac为例) 1.替换hosts文件中的内容,文件链接如下: https://github.com/racaljk/hosts 2.下载Google浏览器,链接如下: http ...

  10. SSH公钥认证+优化

    一 ssh公钥认证流程: sshclinet机器:产生公私钥(公钥相当于一把锁) sshclient:将公钥发给sshserver(抛出锁子) sshclinet去连sshserver不需要密钥   ...