public class ShadowLighteHelper
extends java.lang.Object
限定符和类型 | 方法和说明 |
---|---|
static java.awt.image.BufferedImage |
createCompatibleImage(int width,
int height)
生成宽度width高度height的BufferedImage
|
static int[] |
getPixels(java.awt.image.BufferedImage img,
int x,
int y,
int w,
int h,
int[] pixels)
Returns an array of pixels, stored as integers, from a
BufferedImage . |
static void |
setPixels(java.awt.image.BufferedImage img,
int x,
int y,
int w,
int h,
int[] pixels)
Writes a rectangular area of pixels in the destination
BufferedImage . |
public static java.awt.image.BufferedImage createCompatibleImage(int width, int height)
public static int[] getPixels(java.awt.image.BufferedImage img, int x, int y, int w, int h, int[] pixels)
Returns an array of pixels, stored as integers, from a
BufferedImage
. The pixels are grabbed from a rectangular
area defined by a location and two dimensions. Calling this method on
an image of type different from BufferedImage.TYPE_INT_ARGB
and BufferedImage.TYPE_INT_RGB
will unmanage the image.
img
- the source imagex
- the x location at which to start grabbing pixelsy
- the y location at which to start grabbing pixelsw
- the width of the rectangle of pixels to grabh
- the height of the rectangle of pixels to grabpixels
- a pre-allocated array of pixels of size w*h; can be nullpixels
if non-null, a new array of integers
otherwisejava.lang.IllegalArgumentException
- is pixels
is non-null and
of length < w*hpublic static void setPixels(java.awt.image.BufferedImage img, int x, int y, int w, int h, int[] pixels)
Writes a rectangular area of pixels in the destination
BufferedImage
. Calling this method on
an image of type different from BufferedImage.TYPE_INT_ARGB
and BufferedImage.TYPE_INT_RGB
will unmanage the image.
img
- the destination imagex
- the x location at which to start storing pixelsy
- the y location at which to start storing pixelsw
- the width of the rectangle of pixels to storeh
- the height of the rectangle of pixels to storepixels
- an array of pixels, stored as integersjava.lang.IllegalArgumentException
- is pixels
is non-null and
of length < w*h