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. Python islower() 方法

    描述 Python islower() 方法检测字符串是否由小写字母组成. 相反的方法:isupper() 方法. 语法 islower() 方法语法: S.islower() 参数 无. 返回值 如 ...

  2. LWIP移植

  3. 命令行查询DELL服务器信息序列号

    Windows 获取序列号>wmic bios get serialnumber 获取机型信息>wmic csproduct get vendor,name,identifyingnumb ...

  4. 软件测试自动化之- API Test

    API测试 从本质上来说,API测试是用来验证组成软件的那些单个方法的正确性,而不是测试整个系统本身. API测试也被称为单元测试(Unit Testing), 模块测试(Module Testing ...

  5. 利用eChart绘制网页图表

    首先,最好的教程在这里:eCchart eChart所需JS: echarts.min.js china.js echarts.js 页面代码如下: 一.图表 <!DOCTYPE html> ...

  6. python 异步编程

    Python 3.5 协程究竟是个啥 Yushneng · Mar 10th, 2016 原文链接 : How the heck does async/await work in Python 3.5 ...

  7. django 在建模时的一个手贱

    最近在写一个网站,在建立model的时候遇到了一些问题,最后找了好久才找到为什么. 一.django的model定义如下: from django.db import models # Create ...

  8. An example of using Pandas for regression

    An example of using Pandas for regression 这个例子来自这本书 - "Python for Data Analysis", 这本书的作者 W ...

  9. 【Android】19.3 ContentProvider及安卓进一步封装后的相关类

    分类:C#.Android.VS2015: 创建日期:2016-03-08 一.简介 ContentProvider:内容提供程序. Android的ContentProvider与.NET框架的EF ...

  10. CoCos2D-X-2.1.5在Eclipse中导入HelloCpp项目搭建

    1.前言 最新正在做一个校园增强现实的应用,虽然不知道cocos2d-x具体到最后能做成什么样子,但还是拿来试试,本文章仅从在Eclipse中采用复制一个新项目副本的方式来导入一个现成的HelloCp ...