绘制二次曲线:

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. linux内核模块

    一个简单的驱动 模块的使用能使linux内核便于裁剪,根据不同的应用需求得到一个最小的内核,同时调试内核驱动也更为方便,比如如果调试i2c驱动,如果不采用模块的方式,那么每次修改i2c驱动就得编译整个 ...

  2. hadooop2.6 job pending research

    https://hadoop.apache.org/docs/r2.6.0/hadoop-project-dist/hadoop-common/ClusterSetup.html 我使用的是已经运行在 ...

  3. [转]Javascript中的自执行函数表达式

    [转]Javascript中的自执行函数表达式 本文转载自:http://www.ghugo.com/javascript-auto-run-function/ 以下是正文: Posted on 20 ...

  4. 【读书笔记《Android游戏编程之从零开始》】20.游戏开发基础(游戏数据存储)

    对于数据的存储,Android 提供了4种保存方式. (1)SharedPreference 此方法适用于简单数据的保持,文如其名,属于配置性质的保存,不适合比较大的情况,默认存放在手机内存里 (2) ...

  5. [转]MySQL数据库的优化-运维架构师必会高薪技能,笔者近六年来一线城市工作实战经验

    本文转自:http://liangweilinux.blog.51cto.com/8340258/1728131 年,嘿,废话不多说,下面开启MySQL优化之旅! 我们究竟应该如何对MySQL数据库进 ...

  6. 数论+spfa算法 bzoj 2118 墨墨的等式

    2118: 墨墨的等式 Time Limit: 10 Sec  Memory Limit: 259 MBSubmit: 1283  Solved: 496 Description 墨墨突然对等式很感兴 ...

  7. 树形DP codevs 1814 最长链

    codevs 1814 最长链  时间限制: 1 s  空间限制: 256000 KB  题目等级 : 钻石 Diamond 题目描述 Description 现给出一棵N个结点二叉树,问这棵二叉树中 ...

  8. Zbrush遮罩边界该怎么实现羽化和锐化

    很多情况下为了雕刻制图需要,在ZBrush®中不仅要使用边缘清晰的遮罩,有时还要将遮罩边缘变得模糊,做羽化效果.那么如何在ZBrush中实现羽化遮罩效果或锐化遮罩效果,本文将做详细讲解. 若有疑问可直 ...

  9. poj-3739. Special Squares(二维前缀和)

    题目链接: I. Special Squares There are some points and lines parellel to x-axis or y-axis on the plane. ...

  10. Unity4.6新UI系统初探(uGUI)

    一.引言 Unity终于在即将到来的4.6版本内集成了所见即所得的UI解决方案(视频).事实上从近几个版本开始,Unity就在为这套系统做技术扩展,以保证最终能实现较理想的UI系统.本文试图通过初步的 ...