public interface GraphicsUtils
Modifier and Type | Method and Description |
---|---|
BufferedImage |
copyBufferedImage(BufferedImage img)
Produces a copy of a buffered image with the same graphic content (pixel color)
|
BufferedImage |
createBufferedImage(int w,
int h,
int type)
Create a buffered Image of the given size and type.
|
PrintAttributes |
createPrintAttributes()
Creates an object that implements the PrintAttributes interface with default/trivial values.
|
Font |
deriveFont(Font srcfont,
float newheight)
Returns an istance of Font which is the same as the one provided except for the size.
|
int |
getScreenDPI()
Returns device screen DPI (dots per inch)
|
void |
setRenderingHintsForDrawing(Graphics2D g)
Sets the rendering hints to the Graphics2D object in a way that is suitable for drawing.
|
void |
setRenderingHintsForPrinting(Graphics2D g)
Sets the rendering hints to the Graphics2D object in a way that is suitable for printing.
|
void |
translate(Graphics2D g,
double x,
double y)
Adds a translation operation to the Graphics2D object's transformation matrix.
|
BufferedImage createBufferedImage(int w, int h, int type)
w
- width in pixels of the requested imageh
- height in pixels of the requested imagetype
- image type (refers to bands, etc. see Image
BufferedImage copyBufferedImage(BufferedImage img)
img
- image to be copiedFont deriveFont(Font srcfont, float newheight)
srcfont
- provided font to be used as modelnewheight
- height in pixels of the new fonrint getScreenDPI()
void translate(Graphics2D g, double x, double y)
g
- Object whose transformation matrix has to be modifiedx
- horizontal offset of the translationy
- vertical offset of the translationPrintAttributes createPrintAttributes()
void setRenderingHintsForDrawing(Graphics2D g)
g
- the Graphics2D object whose rendering hints have to be set for drawingvoid setRenderingHintsForPrinting(Graphics2D g)
g
- the Graphics2D object whose rendering hints have to be set for printing