绘制二次曲线:

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. Hadoop step by step _ install and configuration environment

    1.安装centos linux系统. 2.配置静态IP 3.配置防火墙 4.添加hadoop用户 5.检查并安装jdk 配置环境变量 6.配置sshd服务 7.配置ssh免密码登录 8.格式化nam ...

  2. 用pygame学习初级python(一) 15.4.19

    最近有计划要学一下python,主要是要用flask.django一些框架进行后端的学习工作,但是在web应用之前希望进行一些基础的项目进行一些语法的练习,熟悉一下写法, 这个时候我就想先做几个小游戏 ...

  3. Golang 实现简单的滚动读取文本更新

    这个小程序要实现的效果,简单地说,就是将目标文件的内容读取输出到终端,并且目标文件并不是静态的,而是随时会添加新的内容.我们的目标就是一旦目标文件添加了新的内容,就把它读取出来并且显示到终端上. 实现 ...

  4. Java开发和运行环境的搭建

    Java开发需要准备的东西? JDK+Eclipse 其中JDK的意思是Java开发工具包,Eclipse是进行用于做Java程序开发的工具(当然你也可以用记事本什么的去做). 其他开发工具:JCre ...

  5. redis 一二事 - 设置过期时间,以文件夹形式展示key显示缓存数据

    在使用redis时,有时回存在大量数据的时候,而且分类相同,ID相同 可以使用hset来设置,这样有一个大类和一个小分类和一个value组成 但是hset不能设置过期时间 过期时间只能在set上设置 ...

  6. Unity3D开发赛车Demo遇到的问题

    遇到问题 在3D Max中导出的跑车在Unity中轴向不对,不知有没有朋友遇到过呢? 切换坐标系统 在Unity3D中按X键,切换坐标系统 车轮方向变了 运行游戏之后,赛车的车轮方向变歪了 车依然能跑 ...

  7. [3D跑酷] GUIManager UI管理

    UI元素更新及界面跳转 继上篇日志<Unity开发之 GUIClickEventReceiver>,再谈一下我们如何管理游戏中的UI元素更新及界面跳转 UI绑定 图一:Inspector面 ...

  8. Android事件分发机制完全解析,带你从源码的角度彻底理解

    Android事件构成 在Android中,事件主要包括点按.长按.拖拽.滑动等,点按又包括单击和双击,另外还包括单指操作和多指操作.所有这些都构成了Android中的事件响应.总的来说,所有的事件都 ...

  9. 使用CuteSlider做网站炫酷的幻灯片

    cuteSlider 1.预览 官网:http://www.cuteslider.com/ 应用:http://www.dutphonelab.org/ 2.资料 文档:http://pan.baid ...

  10. 利用concat进行数组复制

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...