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. tp表单的提交与验证

    一.控制器如下 引用use app\index\model\User; //注意模型类名不能和控制器类名相同 public function index(){ return $this->fet ...

  2. typedef的用法再思考

    最近重读c语法,有所感悟,记录. 有时候感悟,其实就是猜,假想,作者创建语言的想法,通俗的讲就是丹尼斯灵魂附体了,这个时候任何c语言难点对于你来说,就像吃饭喝水一样简单了,同时还能发现它优美动人之处. ...

  3. ev3dev:设置自动登录wifi

    ev3有时系统不能自动输入wifi密码,在ev3主机上按来按去太麻烦了.看了下官网,解决方案如下: 主要是利用工具:connmanctl,这是一个交互式工具. robot@ev3dev:~$ sudo ...

  4. kindle paperwhite3 连不上WIFI解决方法

    确定能连接上其它的设备比如手机.如果是密码没错,路由器也正常,但是你还是连接不上,那就跟我之前遇到一样了.你先让你的kpw连接一次,不要动,再检查下你路由器连接的客户端列表(我的是在DHCP服务器一栏 ...

  5. ise和modelsim联合仿真的一些准备

    首先要在modelsim中编译xilinx的三个库,分别是unisims库,simprims库,和corelib库,其中unisims库全称为(library of united component ...

  6. 【Android】12.4 利用Intent读取图库中的图片

    分类:C#.Android.VS2015: 创建日期:2016-02-23 一.简介 该示例演示如何从图库(Gallery)中读取图像并用ImageView将它显示出来. 二.示例-ch1203Rea ...

  7. onethink迁移

    修改applicattion下面的Common跟User里面的config.php文件两个

  8. Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: “object”未包括“get_Range”的定义

    asp.net操作Excel合并单元格时,抛出了异常: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: "object" ...

  9. LeetCode: Word Search 解题报告

    Word SearchGiven a 2D board and a word, find if the word exists in the grid. The word can be constru ...

  10. 基于java反射的javabean和map相互转换的工具类

    话不多说,代码如下 package com.study; import java.lang.reflect.Field; import java.util.HashMap; import java.u ...