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. Spark与Pandas中DataFrame对比

      Pandas Spark 工作方式 单机single machine tool,没有并行机制parallelism不支持Hadoop,处理大量数据有瓶颈 分布式并行计算框架,内建并行机制paral ...

  2. django的hello world 项目

    一.新建一个django项目bester: django-admin startproject bester 二.在bester项目中建一个叫polls的应用程序: cd bester/ python ...

  3. INFINITY的一个坑

    float a=INFINITY; if(a==INFINITY){ cout<<"a is inf"<<endl; }else{ cout<< ...

  4. JAVA-从题目看算法,将输入字符串进行排序并输出

    来看一个排列的样例.它所做的工作是将输入的一个字符串中的全部元素进行排序并输出,比如:你给出的參数是"abc" 则程序会输出:abc acb bac bca cab cba 这是一 ...

  5. angular学习笔记(二十二)-$http.post

    基本语法: $http.post('url',{},{}).success(function(data,status,headers,config){ }).error(function(data,s ...

  6. Ubuntu C/C++开发环境的安装和配置

    安装ubantu会自动安装GCC,但是这个GCC什么文件都不能编译,因为没有一些必须的头文件,所以要安装build-essential这个软件包,安装了这个包会自动安装上g++,libc6-dev,l ...

  7. centos 手动编译 fcitx 各种问题大全

    yum install ncurses-devel   tinyxml-devel sqlite-devel wget http://downloads.sourceforge.net/project ...

  8. form action中如何填写相对目录

    举个例子,你在web-root文件夹有个a.html需要向/web-root/jsp/b.jsp提交form,怎么做 网上看到了一个解决方案,但是要求a是jsp页面而不是html页面 <%!St ...

  9. weblogic连接池问题总结(转载)

    转自:某局Weblogic 连接池问题(现场报告)(Connection has been administratively disabled. Try later.) 目录 1. 概述 3 1.1 ...

  10. mysql root 密码忘记

    首次安装mysql后,使用root登录mysql.终端会提示需要输入密码.可是安装的过程并没有提示输入root的密码.怎么办呢?通过修改my.conf配置绕开mysql的授权验证,重置root用户的密 ...