Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
JavaXT
HOME
DOWNLOADS
DOCUMENTATION
WIKI
ABOUT
Image Class
Used to open, resize, rotate, crop and save images.
Constructors
public Image( String PathToImageFile )
public Image( java.io.File file )
public Image( java.io.InputStream InputStream )
public Image( byte[] byteArray )
public Image( int width, int height )
public Image( java.awt.image.BufferedImage bufferedImage )
public Image( java.awt.image.RenderedImage img )
public Image( String text, String fontName, int fontSize, int r, int g, int b )
public Image( String text, java.awt.Font font, int r, int g, int b )
Methods
addImage( java.awt.image.BufferedImage in, int x, int y, boolean expand ) returns void
Used to add an image "overlay" to the existing image at a given position. This method can also be used to create image mosiacs.
addText( String text, int x, int y, java.awt.Font font, int r, int g, int b ) returns void
Used to add text to the image at a given position.
text
x Lower left coordinate of the text
y Lower left coordinate of the text
font Font
r Value for the red channel (0-255)
g Value for the green channel (0-255)
b Value for the blue channel (0-255)
le:///home/vlad/JavaXT%20Core.html 1/5
1/5/2017 JavaXT Core
addText( String text, int x, int y, String fontName, int fontSize, int r, int g, int b ) returns void
Used to add text to the image at a given position.
text
x Lower left coordinate of the text
y Lower left coordinate of the text
fontName Name of the font face (e.g. "Tahoma", "Helvetica", etc.)
fontSize Size of the font
r Value for the red channel (0-255)
g Value for the green channel (0-255)
b Value for the blue channel (0-255)
le:///home/vlad/JavaXT%20Core.html 3/5
1/5/2017 JavaXT Core
//Print unknown tags
for (IIOMetadataNode unknownNode : metadata.getMetadataByTagName("unknown")){
int marker = Integer.parseInt(javaxt.xml.DOM.getAttributeValue(unknownNode, "MarkerTag"));
System.out.println(marker + "\t" + "0x" + Integer.toHexString(marker));
}
setCorners( float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3 ) returns void
Used to skew an image by updating the corner coordinates. Coordinates are supplied in clockwise order starting from the upper left
corner.
le:///home/vlad/JavaXT%20Core.html 4/5
1/5/2017 JavaXT Core
setOpacity( double percent ) returns void
le:///home/vlad/JavaXT%20Core.html 5/5