jimgpnt.util
Class BufferedImageTool

java.lang.Object
  extended by jimgpnt.util.BufferedImageTool

public class BufferedImageTool
extends java.lang.Object

A collection of static methods to fool with BufferedImages.

Copyright (c) 2004 Alistair Dickie. All Rights Reserved. See alistairdickie.com for contact details See licence.txt for licence infomation


Constructor Summary
BufferedImageTool()
           
 
Method Summary
static boolean clipboardHasImage()
          Returns clipboardHasImage(Toolkit.getDefaultToolkit().getSystemClipboard())
static boolean clipboardHasImage(java.awt.datatransfer.Clipboard aClip)
          Determines if aClip has a Tranferable with a DataFlavor of DataFlavor.imageFlavor
static java.awt.image.BufferedImage copy(java.awt.Image in)
          A returns copy(in, BufferedImage.TYPE_INT_ARGB)
static java.awt.image.BufferedImage copy(java.awt.Image in, int biType)
          Creates a copy of in and returns a BufferedImage of biType
static java.awt.image.BufferedImage makeTransBGColor(java.awt.image.BufferedImage in, java.awt.Color color)
          Turns any fully transparent pixel to the Color of color using the setRGB(x,y, int RGB) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferedImageTool

public BufferedImageTool()
Method Detail

makeTransBGColor

public static java.awt.image.BufferedImage makeTransBGColor(java.awt.image.BufferedImage in,
                                                            java.awt.Color color)
Turns any fully transparent pixel to the Color of color using the setRGB(x,y, int RGB) method. Note that it is assumed that in is an ARGB Buffered Image, or that band index 3 of its raster is the tranparent one

Parameters:
in - An intARBG BufferedImage
color - The color to replace with
Returns:
The modified in

copy

public static java.awt.image.BufferedImage copy(java.awt.Image in,
                                                int biType)
Creates a copy of in and returns a BufferedImage of biType

Parameters:
in - An Image
biType - A BufferedImage type
Returns:
A new BufferedImage

copy

public static java.awt.image.BufferedImage copy(java.awt.Image in)
A returns copy(in, BufferedImage.TYPE_INT_ARGB)

Parameters:
in - An Image
Returns:
A new BufferedImage

clipboardHasImage

public static boolean clipboardHasImage(java.awt.datatransfer.Clipboard aClip)
Determines if aClip has a Tranferable with a DataFlavor of DataFlavor.imageFlavor

Parameters:
aClip - A Clipboard
Returns:
true if the Clipboard has a Tranferable with a DataFlavor of DataFlavor.imageFlavor

clipboardHasImage

public static boolean clipboardHasImage()
Returns clipboardHasImage(Toolkit.getDefaultToolkit().getSystemClipboard())

Returns:
true if the System Clipboard has a Tranferable with a DataFlavor of DataFlavor.imageFlavor


Copyright © 2004 Alistair Dickie. All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

1. The origin of this Software must not be misrepresented; you must not claim that you wrote the original software. If you use the Software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original Software.

3. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Alistair Dickie - See alistairdickie.com for contact details.