java.awt.Image#getSource()源码实例Demo

下面列出了java.awt.Image#getSource() 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: openjdk-jdk9   文件: ImageFilterTest.java
public static void test(MyImageFilter testFilter) {
    Image image = new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB);
    FilteredImageSource filtered =
            new FilteredImageSource(image.getSource(), testFilter);

    Image img = Toolkit.getDefaultToolkit().createImage(filtered);

    BufferedImage buffImage = new BufferedImage(img.getWidth(null),
            img.getHeight(null), BufferedImage.TYPE_INT_ARGB);
}
 
源代码2 项目: jdk8u_jdk   文件: MultiResolutionToolkitImage.java
public MultiResolutionToolkitImage(Image lowResolutionImage, Image resolutionVariant) {
    super(lowResolutionImage.getSource());
    this.resolutionVariant = resolutionVariant;
}
 
源代码3 项目: binnavi   文件: ImageHelper.java
public static Image filterImage(final Image inImage, final ImageFilter filter) {
  final ImageProducer imageProducer = new FilteredImageSource(inImage.getSource(), filter);
  return Toolkit.getDefaultToolkit().createImage(imageProducer);
}
 
public MultiResolutionToolkitImage(Image lowResolutionImage, Image resolutionVariant) {
    super(lowResolutionImage.getSource());
    this.resolutionVariant = resolutionVariant;
}
 
源代码5 项目: WorldGrower   文件: BackgroundPainter.java
private Image filterImage(Image sourceImage, ImageFilter imageFilter) {
	ImageProducer ip = new FilteredImageSource(sourceImage.getSource(), imageFilter);
	return Toolkit.getDefaultToolkit().createImage(ip);
}
 
源代码6 项目: pumpernickel   文件: ImageLoader.java
protected static BufferedImage createImage(Image i, String description) {
	ImageLoader l = new ImageLoader(i.getSource(), null, null, description);
	return l.getImage();
}
 
源代码7 项目: WorldGrower   文件: ImageInfoReader.java
private BufferedImage createGhostImage(Image image) {
	ImageFilter filter = new GrayFilter(true, 50);  
	ImageProducer producer = new FilteredImageSource(image.getSource(), filter);  
	Image toolkitImage = Toolkit.getDefaultToolkit().createImage(producer);  
	return ImageUtils.toBufferedImage(toolkitImage);
}
 
public MultiResolutionToolkitImage(Image lowResolutionImage, Image resolutionVariant) {
    super(lowResolutionImage.getSource());
    this.resolutionVariant = resolutionVariant;
}
 
源代码9 项目: Java8CN   文件: PixelGrabber.java
/**
 * Create a PixelGrabber object to grab the (x, y, w, h) rectangular
 * section of pixels from the specified image.  The pixels are
 * accumulated in the original ColorModel if the same ColorModel
 * is used for every call to setPixels, otherwise the pixels are
 * accumulated in the default RGB ColorModel.  If the forceRGB
 * parameter is true, then the pixels will be accumulated in the
 * default RGB ColorModel anyway.  A buffer is allocated by the
 * PixelGrabber to hold the pixels in either case.  If {@code (w < 0)} or
 * {@code (h < 0)}, then they will default to the remaining width and
 * height of the source data when that information is delivered.
 * @param img the image to retrieve the image data from
 * @param x the x coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image, relative to the default
 * (unscaled) size of the image
 * @param y the y coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image
 * @param w the width of the rectangle of pixels to retrieve
 * @param h the height of the rectangle of pixels to retrieve
 * @param forceRGB true if the pixels should always be converted to
 * the default RGB ColorModel
 */
public PixelGrabber(Image img, int x, int y, int w, int h,
                    boolean forceRGB)
{
    producer = img.getSource();
    dstX = x;
    dstY = y;
    dstW = w;
    dstH = h;
    if (forceRGB) {
        imageModel = ColorModel.getRGBdefault();
    }
}
 
源代码10 项目: jdk1.8-source-analysis   文件: PixelGrabber.java
/**
 * Create a PixelGrabber object to grab the (x, y, w, h) rectangular
 * section of pixels from the specified image.  The pixels are
 * accumulated in the original ColorModel if the same ColorModel
 * is used for every call to setPixels, otherwise the pixels are
 * accumulated in the default RGB ColorModel.  If the forceRGB
 * parameter is true, then the pixels will be accumulated in the
 * default RGB ColorModel anyway.  A buffer is allocated by the
 * PixelGrabber to hold the pixels in either case.  If {@code (w < 0)} or
 * {@code (h < 0)}, then they will default to the remaining width and
 * height of the source data when that information is delivered.
 * @param img the image to retrieve the image data from
 * @param x the x coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image, relative to the default
 * (unscaled) size of the image
 * @param y the y coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image
 * @param w the width of the rectangle of pixels to retrieve
 * @param h the height of the rectangle of pixels to retrieve
 * @param forceRGB true if the pixels should always be converted to
 * the default RGB ColorModel
 */
public PixelGrabber(Image img, int x, int y, int w, int h,
                    boolean forceRGB)
{
    producer = img.getSource();
    dstX = x;
    dstY = y;
    dstW = w;
    dstH = h;
    if (forceRGB) {
        imageModel = ColorModel.getRGBdefault();
    }
}
 
源代码11 项目: jdk-1.7-annotated   文件: PixelGrabber.java
/**
 * Create a PixelGrabber object to grab the (x, y, w, h) rectangular
 * section of pixels from the specified image.  The pixels are
 * accumulated in the original ColorModel if the same ColorModel
 * is used for every call to setPixels, otherwise the pixels are
 * accumulated in the default RGB ColorModel.  If the forceRGB
 * parameter is true, then the pixels will be accumulated in the
 * default RGB ColorModel anyway.  A buffer is allocated by the
 * PixelGrabber to hold the pixels in either case.  If (w < 0) or
 * (h < 0), then they will default to the remaining width and
 * height of the source data when that information is delivered.
 * @param img the image to retrieve the image data from
 * @param x the x coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image, relative to the default
 * (unscaled) size of the image
 * @param y the y coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image
 * @param w the width of the rectangle of pixels to retrieve
 * @param h the height of the rectangle of pixels to retrieve
 * @param forceRGB true if the pixels should always be converted to
 * the default RGB ColorModel
 */
public PixelGrabber(Image img, int x, int y, int w, int h,
                    boolean forceRGB)
{
    producer = img.getSource();
    dstX = x;
    dstY = y;
    dstW = w;
    dstH = h;
    if (forceRGB) {
        imageModel = ColorModel.getRGBdefault();
    }
}
 
源代码12 项目: openjdk-8-source   文件: PixelGrabber.java
/**
 * Create a PixelGrabber object to grab the (x, y, w, h) rectangular
 * section of pixels from the specified image.  The pixels are
 * accumulated in the original ColorModel if the same ColorModel
 * is used for every call to setPixels, otherwise the pixels are
 * accumulated in the default RGB ColorModel.  If the forceRGB
 * parameter is true, then the pixels will be accumulated in the
 * default RGB ColorModel anyway.  A buffer is allocated by the
 * PixelGrabber to hold the pixels in either case.  If {@code (w < 0)} or
 * {@code (h < 0)}, then they will default to the remaining width and
 * height of the source data when that information is delivered.
 * @param img the image to retrieve the image data from
 * @param x the x coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image, relative to the default
 * (unscaled) size of the image
 * @param y the y coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image
 * @param w the width of the rectangle of pixels to retrieve
 * @param h the height of the rectangle of pixels to retrieve
 * @param forceRGB true if the pixels should always be converted to
 * the default RGB ColorModel
 */
public PixelGrabber(Image img, int x, int y, int w, int h,
                    boolean forceRGB)
{
    producer = img.getSource();
    dstX = x;
    dstY = y;
    dstW = w;
    dstH = h;
    if (forceRGB) {
        imageModel = ColorModel.getRGBdefault();
    }
}
 
源代码13 项目: openjdk-jdk8u   文件: PixelGrabber.java
/**
 * Create a PixelGrabber object to grab the (x, y, w, h) rectangular
 * section of pixels from the specified image.  The pixels are
 * accumulated in the original ColorModel if the same ColorModel
 * is used for every call to setPixels, otherwise the pixels are
 * accumulated in the default RGB ColorModel.  If the forceRGB
 * parameter is true, then the pixels will be accumulated in the
 * default RGB ColorModel anyway.  A buffer is allocated by the
 * PixelGrabber to hold the pixels in either case.  If {@code (w < 0)} or
 * {@code (h < 0)}, then they will default to the remaining width and
 * height of the source data when that information is delivered.
 * @param img the image to retrieve the image data from
 * @param x the x coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image, relative to the default
 * (unscaled) size of the image
 * @param y the y coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image
 * @param w the width of the rectangle of pixels to retrieve
 * @param h the height of the rectangle of pixels to retrieve
 * @param forceRGB true if the pixels should always be converted to
 * the default RGB ColorModel
 */
public PixelGrabber(Image img, int x, int y, int w, int h,
                    boolean forceRGB)
{
    producer = img.getSource();
    dstX = x;
    dstY = y;
    dstW = w;
    dstH = h;
    if (forceRGB) {
        imageModel = ColorModel.getRGBdefault();
    }
}
 
源代码14 项目: Java8CN   文件: PixelGrabber.java
/**
 * Create a PixelGrabber object to grab the (x, y, w, h) rectangular
 * section of pixels from the specified image into the given array.
 * The pixels are stored into the array in the default RGB ColorModel.
 * The RGB data for pixel (i, j) where (i, j) is inside the rectangle
 * (x, y, w, h) is stored in the array at
 * <tt>pix[(j - y) * scansize + (i - x) + off]</tt>.
 * @see ColorModel#getRGBdefault
 * @param img the image to retrieve pixels from
 * @param x the x coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image, relative to the default
 * (unscaled) size of the image
 * @param y the y coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image
 * @param w the width of the rectangle of pixels to retrieve
 * @param h the height of the rectangle of pixels to retrieve
 * @param pix the array of integers which are to be used to hold the
 * RGB pixels retrieved from the image
 * @param off the offset into the array of where to store the first pixel
 * @param scansize the distance from one row of pixels to the next in
 * the array
 */
public PixelGrabber(Image img, int x, int y, int w, int h,
                    int[] pix, int off, int scansize) {
    this(img.getSource(), x, y, w, h, pix, off, scansize);
}
 
源代码15 项目: openjdk-8   文件: PixelGrabber.java
/**
 * Create a PixelGrabber object to grab the (x, y, w, h) rectangular
 * section of pixels from the specified image into the given array.
 * The pixels are stored into the array in the default RGB ColorModel.
 * The RGB data for pixel (i, j) where (i, j) is inside the rectangle
 * (x, y, w, h) is stored in the array at
 * <tt>pix[(j - y) * scansize + (i - x) + off]</tt>.
 * @see ColorModel#getRGBdefault
 * @param img the image to retrieve pixels from
 * @param x the x coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image, relative to the default
 * (unscaled) size of the image
 * @param y the y coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image
 * @param w the width of the rectangle of pixels to retrieve
 * @param h the height of the rectangle of pixels to retrieve
 * @param pix the array of integers which are to be used to hold the
 * RGB pixels retrieved from the image
 * @param off the offset into the array of where to store the first pixel
 * @param scansize the distance from one row of pixels to the next in
 * the array
 */
public PixelGrabber(Image img, int x, int y, int w, int h,
                    int[] pix, int off, int scansize) {
    this(img.getSource(), x, y, w, h, pix, off, scansize);
}
 
源代码16 项目: jdk-1.7-annotated   文件: PixelGrabber.java
/**
 * Create a PixelGrabber object to grab the (x, y, w, h) rectangular
 * section of pixels from the specified image into the given array.
 * The pixels are stored into the array in the default RGB ColorModel.
 * The RGB data for pixel (i, j) where (i, j) is inside the rectangle
 * (x, y, w, h) is stored in the array at
 * <tt>pix[(j - y) * scansize + (i - x) + off]</tt>.
 * @see ColorModel#getRGBdefault
 * @param img the image to retrieve pixels from
 * @param x the x coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image, relative to the default
 * (unscaled) size of the image
 * @param y the y coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image
 * @param w the width of the rectangle of pixels to retrieve
 * @param h the height of the rectangle of pixels to retrieve
 * @param pix the array of integers which are to be used to hold the
 * RGB pixels retrieved from the image
 * @param off the offset into the array of where to store the first pixel
 * @param scansize the distance from one row of pixels to the next in
 * the array
 */
public PixelGrabber(Image img, int x, int y, int w, int h,
                    int[] pix, int off, int scansize) {
    this(img.getSource(), x, y, w, h, pix, off, scansize);
}
 
源代码17 项目: TencentKona-8   文件: PixelGrabber.java
/**
 * Create a PixelGrabber object to grab the (x, y, w, h) rectangular
 * section of pixels from the specified image into the given array.
 * The pixels are stored into the array in the default RGB ColorModel.
 * The RGB data for pixel (i, j) where (i, j) is inside the rectangle
 * (x, y, w, h) is stored in the array at
 * <tt>pix[(j - y) * scansize + (i - x) + off]</tt>.
 * @see ColorModel#getRGBdefault
 * @param img the image to retrieve pixels from
 * @param x the x coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image, relative to the default
 * (unscaled) size of the image
 * @param y the y coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image
 * @param w the width of the rectangle of pixels to retrieve
 * @param h the height of the rectangle of pixels to retrieve
 * @param pix the array of integers which are to be used to hold the
 * RGB pixels retrieved from the image
 * @param off the offset into the array of where to store the first pixel
 * @param scansize the distance from one row of pixels to the next in
 * the array
 */
public PixelGrabber(Image img, int x, int y, int w, int h,
                    int[] pix, int off, int scansize) {
    this(img.getSource(), x, y, w, h, pix, off, scansize);
}
 
源代码18 项目: jdk8u-dev-jdk   文件: PixelGrabber.java
/**
 * Create a PixelGrabber object to grab the (x, y, w, h) rectangular
 * section of pixels from the specified image into the given array.
 * The pixels are stored into the array in the default RGB ColorModel.
 * The RGB data for pixel (i, j) where (i, j) is inside the rectangle
 * (x, y, w, h) is stored in the array at
 * <tt>pix[(j - y) * scansize + (i - x) + off]</tt>.
 * @see ColorModel#getRGBdefault
 * @param img the image to retrieve pixels from
 * @param x the x coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image, relative to the default
 * (unscaled) size of the image
 * @param y the y coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image
 * @param w the width of the rectangle of pixels to retrieve
 * @param h the height of the rectangle of pixels to retrieve
 * @param pix the array of integers which are to be used to hold the
 * RGB pixels retrieved from the image
 * @param off the offset into the array of where to store the first pixel
 * @param scansize the distance from one row of pixels to the next in
 * the array
 */
public PixelGrabber(Image img, int x, int y, int w, int h,
                    int[] pix, int off, int scansize) {
    this(img.getSource(), x, y, w, h, pix, off, scansize);
}
 
源代码19 项目: JDKSourceCode1.8   文件: PixelGrabber.java
/**
 * Create a PixelGrabber object to grab the (x, y, w, h) rectangular
 * section of pixels from the specified image into the given array.
 * The pixels are stored into the array in the default RGB ColorModel.
 * The RGB data for pixel (i, j) where (i, j) is inside the rectangle
 * (x, y, w, h) is stored in the array at
 * <tt>pix[(j - y) * scansize + (i - x) + off]</tt>.
 * @see ColorModel#getRGBdefault
 * @param img the image to retrieve pixels from
 * @param x the x coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image, relative to the default
 * (unscaled) size of the image
 * @param y the y coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image
 * @param w the width of the rectangle of pixels to retrieve
 * @param h the height of the rectangle of pixels to retrieve
 * @param pix the array of integers which are to be used to hold the
 * RGB pixels retrieved from the image
 * @param off the offset into the array of where to store the first pixel
 * @param scansize the distance from one row of pixels to the next in
 * the array
 */
public PixelGrabber(Image img, int x, int y, int w, int h,
                    int[] pix, int off, int scansize) {
    this(img.getSource(), x, y, w, h, pix, off, scansize);
}
 
源代码20 项目: Bytecoder   文件: PixelGrabber.java
/**
 * Create a PixelGrabber object to grab the (x, y, w, h) rectangular
 * section of pixels from the specified image into the given array.
 * The pixels are stored into the array in the default RGB ColorModel.
 * The RGB data for pixel (i, j) where (i, j) is inside the rectangle
 * (x, y, w, h) is stored in the array at
 * {@code pix[(j - y) * scansize + (i - x) + off]}.
 * @see ColorModel#getRGBdefault
 * @param img the image to retrieve pixels from
 * @param x the x coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image, relative to the default
 * (unscaled) size of the image
 * @param y the y coordinate of the upper left corner of the rectangle
 * of pixels to retrieve from the image
 * @param w the width of the rectangle of pixels to retrieve
 * @param h the height of the rectangle of pixels to retrieve
 * @param pix the array of integers which are to be used to hold the
 * RGB pixels retrieved from the image
 * @param off the offset into the array of where to store the first pixel
 * @param scansize the distance from one row of pixels to the next in
 * the array
 */
public PixelGrabber(Image img, int x, int y, int w, int h,
                    int[] pix, int off, int scansize) {
    this(img.getSource(), x, y, w, h, pix, off, scansize);
}