|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectportaview.util.ImageUtils
Image utilities to process JPG images.
| Constructor Summary | |
ImageUtils()
|
|
| Method Summary | |
static void |
drawBorder(java.awt.Graphics2D g,
float trans,
int bwidth,
int maxWidth,
int maxHeight,
java.awt.Color c)
Draws border around the graphics |
static void |
drawBorder(java.awt.Graphics2D g,
float trans,
int bwidth,
int xoffset,
int yoffset,
int maxWidth,
int maxHeight,
java.awt.Color c)
Draws border around the graphics |
static void |
drawBorder(PortaViewModel pvm,
java.awt.image.BufferedImage bi)
Draw the image according to the specified settings. |
static void |
drawBorderRatio(java.awt.Graphics2D g,
float trans,
int ratio,
int maxWidth,
int maxHeight,
java.awt.Color c)
Draws border around the graphics with the width expressed as a ratio to the whole image. |
static void |
drawBorderRatio(java.awt.Graphics2D g,
float trans,
int ratio,
int xoffset,
int yoffset,
int maxWidth,
int maxHeight,
java.awt.Color c)
Draws border around the graphics with the width expressed as a ratio to the whole image. |
static java.awt.image.BufferedImage |
getBufferedImage(java.io.File file,
java.awt.Component c)
Returns a buffered image based on the file an component to draw on. |
static java.awt.image.BufferedImage |
getBufferedImage(java.awt.Image img,
java.awt.Component c)
Similar to getBufferedImage(File, Component), load the BufferedImage from an Image. |
static java.awt.image.BufferedImage |
getBufferedImageInFrame(java.awt.image.BufferedImage bi,
int fwidth,
int fheight,
java.awt.Component c)
Returns a buffered image, resized to fit the frame specified by fwidth and fheight. |
static java.awt.image.BufferedImage |
getBufferedImageInFrame(java.io.File f,
int fwidth,
int fheight,
java.awt.Component c)
Returns a buffered image, resized to fit the frame specified by fwidth and fheight. |
static java.awt.Image |
getImage(byte[] bytes)
Returns the image given the JPEG encoding in a byte array. |
static java.awt.Image |
getImage(java.io.File file)
Similar to getImage(String), load from a File instead of the file name. |
static java.awt.Image |
getImage(java.lang.String filename)
Similar to getImage(URL), load from a filename instead of the URL. |
static java.awt.Image |
getImage(java.net.URL url)
Returns the image associated with the url |
static byte[] |
getScaledImage(java.io.File f,
int width,
int height)
Returns the JPEG encoding of a scaled image. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ImageUtils()
| Method Detail |
public static java.awt.Image getImage(java.net.URL url)
throws java.lang.Exception
url - url to get the image
java.lang.Exception - when getting the image fails.
public static java.awt.Image getImage(java.lang.String filename)
throws java.lang.Exception
java.lang.Exception
public static java.awt.Image getImage(java.io.File file)
throws java.lang.Exception
java.lang.Exceptionpublic static java.awt.Image getImage(byte[] bytes)
bytes - byte array that contains the JPEG encoding of the image.
public static java.awt.image.BufferedImage getBufferedImage(java.io.File file,
java.awt.Component c)
throws java.lang.Exception
file - file to retrievec - component to draw on
java.lang.Exception - when loading of the image fails.
public static java.awt.image.BufferedImage getBufferedImage(java.awt.Image img,
java.awt.Component c)
throws java.lang.Exception
img - image to loadc - component to draw on
java.lang.Exception - when fails to load.
public static java.awt.image.BufferedImage getBufferedImageInFrame(java.awt.image.BufferedImage bi,
int fwidth,
int fheight,
java.awt.Component c)
throws java.lang.Exception
bi - Buffered image that contains the source for the image.fwidth - frame widthfheight - heightc - component to draw the image from.
java.lang.Exception
public static java.awt.image.BufferedImage getBufferedImageInFrame(java.io.File f,
int fwidth,
int fheight,
java.awt.Component c)
throws java.lang.Exception
f - file to load the image fromfwidth - frame widthfheight - heightc - component to draw the image from.
java.lang.Exception
public static byte[] getScaledImage(java.io.File f,
int width,
int height)
throws java.lang.Exception
f - image file.width - desired width for the imageheight - desired height for image
java.lang.Exception - when scaling fails.
public static void drawBorderRatio(java.awt.Graphics2D g,
float trans,
int ratio,
int maxWidth,
int maxHeight,
java.awt.Color c)
g - graphic to draw onratio - goes from 0 to 30, which means the % of the picture.maxWidth - maximum width of graphicsmaxHeight - maximum height of graphicsc - the color of the border
public static void drawBorderRatio(java.awt.Graphics2D g,
float trans,
int ratio,
int xoffset,
int yoffset,
int maxWidth,
int maxHeight,
java.awt.Color c)
g - graphic to draw onratio - goes from 0 to 30, which means the % of the picture.xoffset - the x coordinate offsetyoffset - the y coordinate offsetmaxWidth - maximum width of graphicsmaxHeight - maximum height of graphicsc - the color of the border
public static void drawBorder(java.awt.Graphics2D g,
float trans,
int bwidth,
int xoffset,
int yoffset,
int maxWidth,
int maxHeight,
java.awt.Color c)
g - graphic to draw onbwidth - border widthxoffset - the x coordinate offsetyoffset - the y coordinate offsetmaxWidth - maximum width of graphicsmaxHeight - maximum height of graphicsc - the color of the border
public static void drawBorder(java.awt.Graphics2D g,
float trans,
int bwidth,
int maxWidth,
int maxHeight,
java.awt.Color c)
g - graphic to draw onbwidth - border widthmaxWidth - maximum width of graphicsmaxHeight - maximum height of graphicsc - the color of the border
public static void drawBorder(PortaViewModel pvm,
java.awt.image.BufferedImage bi)
pvm - bi -
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||