Image 相关的类

1.

   图片中信息:

                 图片的 长  宽 

                图片的上下文信息

                图片的像素信息

               

   Image: 抽象类,实现的子类:BufferedImage, VolatileImage

   BufferedImage: 缓冲区的图片信息,图片信息与ColorModel 和 Raster组成。

 

 Raster
getData(Rectangle rect)
          计算并返回 BufferedImage 的一个任意区域。
 WritableRastergetRaster()
          返回 WritableRaster
 ImageProducergetSource()
          返回生成该图像像素的对象。
 BufferedImagegetSubimage(int x, int y, int w, int h)
          返回由指定矩形区域定义的子图像。
  
  
  
  

  ImageIO:静态方法:

static booleanwrite(RenderedImage im, String formatName, File output)
          使用支持给定格式的任意 ImageWriter 将一个图像写入 File
static booleanwrite(RenderedImage im, String formatName, ImageOutputStream output)
          使用支持给定格式的任意 ImageWriter 将一个图像写入 ImageOutputStream
static booleanwrite(RenderedImage im, String formatName, OutputStream output)
          使用支持给定格式的任意 ImageWriter 将一个图像写入 OutputStream
static BufferedImageread(File input)
          返回一个 BufferedImage,作为使用 ImageReader(它是从当前已注册 ImageReader 中自动选择的)解码所提供 File 的结果。
static BufferedImageread(ImageInputStream stream)
          返回一个 BufferedImage,作为使用 ImageReader(它是从当前已注册 ImageReader 中自动选择的)解码所提供 ImageInputStream 的结果。
static BufferedImageread(InputStream input)
          返回一个 BufferedImage,作为使用 ImageReader(它是从当前已注册 ImageReader 中自动选择的)解码所提供 InputStream 的结果。
static BufferedImageread(URL input)
          返回一个 BufferedImage,作为使用 ImageReader(它是从当前已注册 ImageReader 中自动选择的)解码所提供 URL 的结果。

static ImageInputStreamcreateImageInputStream(Object input)
          返回一个 ImageInputStream,它将从给定 Object 中获取输入。
static ImageOutputStreamcreateImageOutputStream(Object output)
          返回一个 ImageOutputStream,它将其输出发送到给定 Object

ImageReader:可以读取图片的信息

                     读取么某一个区域的内容等

ImageWrite:可以修改图片的信息

                    修改替换某一个区域的内容

ImageReadParam:

ImageWriterParan:

  以上来那个对象用来指示读取的范围等参数

ColorConvertOp:  对于像素的操作,进行颜色转化,同时可以得到某一个区域的界框。

FilteredImageSource:接口,

该接口使用现有的图像和过滤器对象作为参数,并使用它们为原图像的新过滤版本产生图像数据。下面的示例通过交换红色和蓝色分量来过滤图像:

 
        Image src = getImage("doc:///demo/images/duke/T1.gif");
        ImageFilter colorfilter = new RedBlueSwapFilter();
        Image img = createImage(new FilteredImageSource(src.getSource(),
                                                        colorfilter));

AreaAveragingScaleFilter:

这是一个 ImageFilter 类,它使用一个简单的区域平均算法来进行图像缩放,该算法产生比其最相近算法更平滑的结果。

ImageProducer: 图片的像素对象 抽象类

Graphics:图片的上下文

abstract  voidclearRect(int x, int y, int width, int height)
          通过使用当前绘图表面的背景色进行填充来清除指定的矩形。
abstract  voidclipRect(int x, int y, int width, int height)
          将当前剪贴区与指定的矩形相交。
abstract  voidcopyArea(int x, int y, int width, int height, int dx, int dy)
          将组件的区域复制到由 dxdy 指定的距离处。
abstract  Graphicscreate()
          创建一个新的 Graphics 对象,它是此 Graphics 对象的副本。
 Graphicscreate(int x, int y, int width, int height)
          基于此 Graphics 对象创建一个新的 Graphics 对象,但是使用新的转换和剪贴区域。
abstract  voiddispose()
          释放此图形的上下文以及它使用的所有系统资源。
 voiddraw3DRect(int x, int y, int width, int height, boolean raised)
          绘制指定矩形的 3-D 高亮显示边框。
abstract  voiddrawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
          绘制一个覆盖指定矩形的圆弧或椭圆弧边框。
 voiddrawBytes(byte[] data, int offset, int length, int x, int y)
          使用此图形上下文的当前字体和颜色绘制由指定 byte 数组给定的文本。
 voiddrawChars(char[] data, int offset, int length, int x, int y)
          使用此图形上下文的当前字体和颜色绘制由指定字符数组给定的文本。
abstract  booleandrawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
          绘制指定图像中当前可用的图像。
abstract  booleandrawImage(Image img, int x, int y, ImageObserver observer)
          绘制指定图像中当前可用的图像。
abstract  booleandrawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
          绘制指定图像中已缩放到适合指定矩形内部的图像。
abstract  booleandrawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
          绘制指定图像中已缩放到适合指定矩形内部的图像。
abstract  booleandrawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)
          绘制当前可用的指定图像的指定区域,动态地缩放图像使其符合目标绘制表面的指定区域。
abstract  booleandrawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
          绘制当前可用的指定图像的指定区域,动态地缩放图像使其符合目标绘制表面的指定区域。
abstract  voiddrawLine(int x1, int y1, int x2, int y2)
          在此图形上下文的坐标系中,使用当前颜色在点 (x1, y1)(x2, y2) 之间画一条线
abstract  voiddrawOval(int x, int y, int width, int height)
          绘制椭圆的边框
abstract  voiddrawPolygon(int[] xPoints, int[] yPoints, int nPoints)
          绘制一个由 xy 坐标数组定义的闭合多边形。
 voiddrawPolygon(Polygon p)
          绘制由指定的 Polygon 对象定义的多边形边框
abstract  voiddrawPolyline(int[] xPoints, int[] yPoints, int nPoints)
          绘制由 xy 坐标数组定义的一系列连接线。
 voiddrawRect(int x, int y, int width, int height)
          绘制指定矩形的边框。
abstract  voiddrawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
          用此图形上下文的当前颜色绘制圆角矩形的边框。
abstract  voiddrawString(AttributedCharacterIterator iterator, int x, int y)
          依据 TextAttribute 类的规范应用指定迭代器的属性,呈现迭代器的文本
abstract  voiddrawString(String str, int x, int y)
          使用此图形上下文的当前字体和颜色绘制由指定 string 给定的文本。
 voidfill3DRect(int x, int y, int width, int height, boolean raised)
          绘制一个用当前颜色填充的 3-D 高亮显示矩形。
abstract  voidfillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
          填充覆盖指定矩形的圆弧或椭圆弧。
abstract  voidfillOval(int x, int y, int width, int height)
          使用当前颜色填充外接指定矩形框的椭圆。
abstract  voidfillPolygon(int[] xPoints, int[] yPoints, int nPoints)
          填充由 xy 坐标数组定义的闭合多边形。
 voidfillPolygon(Polygon p)
          用图形上下文的当前颜色填充指定 Polygon 对象定义的多边形。
abstract  voidfillRect(int x, int y, int width, int height)
          填充指定的矩形。
abstract  voidfillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
          用当前颜色填充指定的圆角矩形。
 voidfinalize()
          一旦不再引用此图形上下文就释放它。
abstract  ShapegetClip()
          获取当前剪贴区域。
abstract  RectanglegetClipBounds()
          返回当前剪贴区域的边界矩形。
 RectanglegetClipBounds(Rectangle r)
          返回当前剪贴区域的边界矩形。
 RectanglegetClipRect()
          已过时。 从 JDK version 1.1 开始,由 getClipBounds() 取代。
abstract  ColorgetColor()
          获取此图形上下文的当前颜色。
abstract  FontgetFont()
          获取当前字体。
 FontMetricsgetFontMetrics()
          获取当前字体的字体规格。
abstract  FontMetricsgetFontMetrics(Font f)
          获取指定字体的字体规格。
 booleanhitClip(int x, int y, int width, int height)
          如果指定的矩形区域与当前的剪贴区域相交,则返回 true。
abstract  voidsetClip(int x, int y, int width, int height)
          将当前剪贴区设置为由给定坐标指定的矩形。
abstract  voidsetClip(Shape clip)
          将当前剪贴区域设置为任意的剪贴形状。
abstract  voidsetColor(Color c)
          将此图形上下文的当前颜色设置为指定颜色。
abstract  voidsetFont(Font font)
          将此图形上下文的字体设置为指定字体。
abstract  voidsetPaintMode()
          设置将此图形上下文的绘图模式,以便通过此图形上下文中的当前颜色来覆盖目标。
abstract  voidsetXORMode(Color c1)
          将此图形上下文的绘图模式设置为在此图形上下文的当前颜色和新的指定颜色之间交替。
  
abstract  voidtranslate(int x, int y)
          将图形上下文的原点平移到当前坐标系中的点 (xy)。(旋转功能)

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值