图像——Java 2D Oracle官方教程翻译(双语对照)

本文翻译自Oracle官方教程
<<Previous • Trail • Next>>

Images

In the Java 2D API an image is typically a rectangular two-dimensional array of pixels, where each pixel represents the color at that position of the image and where the dimensions represent the horizontal extent (width) and vertical extent (height) of the image as it is displayed.

在Java 2D API中图像是典型的像素的矩形二维数组。每一个像素都描述了其所在位置的图像颜色。两个维度分别描述了图像在水平方向上的大小(宽)和在垂直方向上的大小(高)


The most important image class for representing such images is the java.awt.image.BufferedImage class. The Java 2D API stores the contents of such images in memory so that they can be directly accessed.

代表这样的图像的最重要的类就是java.awt.image.BufferedImage。Java 2D API将这样的图像内容保存在内存中以便直接访问。


Applications can directly create a BufferedImage object or obtain an image from an external image format such as PNG or GIF.

应用程序可以直接创建BufferedImage对象,也可以从外部图像格式(比如PNG或GIF)获取图像。


In either case, the application can then draw on to image by using Java 2D API graphics calls. So, images are not limited to displaying photographic type images. Different objects such as line art, text, and other graphics and even other images can be drawn onto an image (as shown on the following images).

在这两种情况下,应用程序都可以使用Java 2D API制图接口继续在图像上作画。所以这里的图像并不限制必须是摄影类型的。不同的对象如线条艺术,文本和其他图画甚至其他图像都可以画在一个图像上面(如下图所示)。


The Java 2D API enables you to apply image filtering operations to BufferedImage and includes several built-in filters. For example, the ConvolveOp filter can be used to blur or sharpen images.

Java 2D API使你可以对BufferedImage应用图像过滤操作,并内置了一些过滤器。例如ConvolveOp过滤器可以用来模糊或锐化图像。


<<Previous • Trail • Next>>

发布了9 篇原创文章 · 获赞 0 · 访问量 642

猜你喜欢

转载自blog.csdn.net/realcfuture/article/details/103987908