To draw on a buffered image, create a graphics context on the buffered image.

    // Create a graphics context on the buffered image
Graphics2D g2d = bimage.createGraphics(); // Draw on the image
g2d.setColor(Color.red);
g2d.fill(new Ellipse2D.Float(0, 0, 200, 100));
g2d.dispose();

If the buffered image supports transparency, (see e661 确定图像中是否有透明像素), pixels can be made transparent:

    g2d = bimage.createGraphics();

    // Make all filled pixels transparent
Color transparent = new Color(0, 0, 0, 0);
g2d.setColor(transparent);
g2d.setComposite(AlphaComposite.Src);
g2d.fill(new Rectangle2D.Float(20, 20, 100, 20));
g2d.dispose();
Related Examples

e669. 绘制缓冲图像的更多相关文章

  1. -_-#【Canvas】导出在<canvas>元素上绘制的图像

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  2. e675. 翻转缓冲图像

    // To create a buffered image, see e666 创建缓冲图像 // Flip the image vertically AffineTransform tx = Aff ...

  3. e666. 创建缓冲图像

    A buffered image is a type of image whose pixels can be modified. For example, you can draw on a buf ...

  4. Matlab绘图基础——利用axes(坐标系图形对象)绘制重叠图像 及 一图多轴(一幅图绘制多个坐标轴)

    描述 axes在当前窗口中创建一个包含默认属性坐标系 axes('PropertyName',propertyvalue,...)创建坐标系时,同时指定它的一些属性,没有指定的使用DefaultAxe ...

  5. Delphi实例之绘制正弦函数图像

    Delphi实例之绘制正弦函数图像 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphic ...

  6. OpenCV 鼠标手动绘制掩码图像

    OpenCV 鼠标手动绘制掩码图像 完整的代码: #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui ...

  7. matplotlib绘制矢量图像(svg),pdf and ps文件

    机器学习的过程中处理数据,会遇到数据可视化的问题. 大部分都是利用python的matplotlib库进行数据的可视化处理. plt.show() 默认都是输出.png文件,图片只要稍微放大一点,就糊 ...

  8. e668. 在一组像素中创建缓冲图像

    This example demonstrates how to convert a byte array of pixel values that are indices to a color ta ...

  9. e667. 在给定图像中创建缓冲图像

    An Image object cannot be converted to a BufferedImage object. The closest equivalent is to create a ...

随机推荐

  1. windows下配置nginx+php环境(转)

    刚看到nginx这个词,我很好奇它的读法(engine x),我的直译是“引擎x”,一般引“擎代”表了性能,而“x”大多出现是表示“xtras(额外的效果)”,那么整个词的意思就是类似“极致效果”,“ ...

  2. unity5 静态和动态cubmap

    一,静态cubemap: asserts窗口 右键->Create->Legacy->Cubemap,新建一个cubemap,命名为cubeMap,然后为其各面指定贴图,如图: 需要 ...

  3. 微服务之springcloud技术栈

    一.微服务架构图: 二.技术介绍:(技术选型随着代码的编写会完成) 关于技术选型,我盗了一张微服务技术栈的图,如下:原文:http://www.jianshu.com/p/2da6becfb019 我 ...

  4. [面试题] Find next higher number with same digits

    Find next higher number with same digits. Example 1 : if num = 25468, o/p = 25486 Example 2 : if num ...

  5. ev3dev :利用ssh登录系统

    ev3dev是在debian 8 的基础上修改的,主页上只介绍了利用usb连接系统后,ssh登录的方法. 可是我想用wifi连接到网络后,用ssh登录,非usb线连接. ev3dev的默认用户名为:r ...

  6. 解决fonts.googleapis.com不能访问,导致网页打不开

    最近,访问linode.com网站,突然发现网速好慢,老是打不开网页.分析一下网页才知道,原来使用了fonts.googleapis.com 打不开的原因就很明显了,咋办呢?百度啊,百度,最后,终于找 ...

  7. winform TreeView 节点选择

    public partial class Form1 : Form { public Form1() { InitializeComponent(); } string tag = "Tru ...

  8. 微信wap开发---页面自适应大小

    <meta name="viewport" content="width=device-width, initial-scale=0.5, minimum-scal ...

  9. ubuntu下超强的截图工具scrot

    Scrot ,是一个命令行下使用的截图工具,支持全屏.窗口.选取.多设备.缩略图.延时,甚至可以截图完毕之后指定某程序打开截好的图片. 终端安装:     sudo apt-get install s ...

  10. 安装Tomcat配置环境变量

    我是从官网下载的zip,没有用installer. 从目前的情况来看,只要你配置好了JAVA_HOME, CLASSPATH, PATH,那么剩下的,目前看来,就只要配置好CATALINA_HOME即 ...