public class ImageRenderer extends Object implements Cloneable
Name: ImageRenderer
Description: Renderer zur Erzeugung von Bildern, allgemeiner Ansatz, jedoch speziell für TIF-Bilder gedacht.
Copyright: Copyright (c) 2004-2008, 2010-2012, 2014, 2016-2020
Company: >StA-Soft<
| Modifier and Type | Field and Description |
|---|---|
protected BufferedImage |
myImage
Aktuelles Bild.
|
protected static String |
STDFILENAME
Muster für Standard-Dateiname.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ImageRenderer()
Standard-Constructor.
|
|
ImageRenderer(String fn)
Constructor mit einem Dateinamen.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearRect(int x,
int y,
int dx,
int dy)
Rechteck mit Hintergrundfarbe füllen.
|
ImageRenderer |
cloneIR()
Kopie des Objekts erstellen.
|
void |
drawImage(Image img,
int x,
int y)
Bild einfügen.
|
void |
drawImageCenter(Image img,
int x,
int y,
int dx,
int dy)
Bild zentriert zeichnen.
|
void |
drawImageZoom(Image img,
int x,
int y,
int dx,
int dy)
Bild ggf. in der Größe angepasst zeichnen.
|
void |
drawLine(int x1,
int y1,
int x2,
int y2)
Linie zeichnen.
|
void |
drawOval(int x,
int y,
int dx,
int dy)
Oval zeichnen.
|
void |
drawPolygon(int[] xx,
int[] yy,
int n)
Polygon zeichnen.
|
void |
drawRectWH(int x,
int y,
int width,
int height)
Rechteck zeichnen, incl. x/y, excl. x+width/y+height
(Aufruf mit 0/0, ImageSizeX/ImageSizeY ergibt also genau einen Rahmen um
das gesamte Bild).
|
void |
fillOval(int x,
int y,
int dx,
int dy)
Oval füllen.
|
void |
fillPolygon(int[] xx,
int[] yy,
int n)
Polygon füllen.
|
void |
fillRect(int x,
int y,
int dx,
int dy)
Rechteck füllen.
|
void |
flush()
Ein ggf. begonnenes Bild speichern.
|
boolean |
getAntialiasing()
Ermitteln, ob Antialiasing verwendet wird.
|
int |
getAscent()
Höhe eines Zeichens ermitteln.
|
Color |
getBackground()
Aktuelle Hintergrundfarbe ermitteln.
|
int |
getBorderBottom()
Größe des unteren Randes ermiteln.
|
int |
getBorderLeft()
Größe des linken Randes ermiteln.
|
int |
getBorderRight()
Größe des rechten Randes ermiteln.
|
int |
getBorderTop()
Größe des oberen Randes ermiteln.
|
Color |
getColor()
Aktuelle Farbe ermitteln.
|
int |
getCurX()
Aktuelle X-Position ermitteln.
|
int |
getCurY()
Aktuelle Y-Position ermitteln.
|
String |
getFileName()
Aktuellen Dateinamen ermitteln.
|
String |
getFontName()
Zeichsatzname ermitteln.
|
int |
getFontSize()
Aktuelle Zeichsatzgröße ermitteln.
|
int |
getFontStyle()
Style ermitteln.
|
int |
getFontStyleIndex()
Style-Index ermitteln.
|
int |
getHeight()
Höhe einer Zeile ermitteln.
|
BufferedImage |
getImage()
Image ermitteln.
|
int |
getImageHeight()
Bildhöhe ermittln.
|
Vector |
getImages()
Alle Images ermitteln.
|
int |
getImageType()
Bildtyp ermitteln.
|
int |
getImageTypeIndex()
Index des Bildtyps ermitteln.
|
int |
getImageWidth()
Bildbreite ermitteln.
|
int |
getPage()
Aktuelle Seite ermittln.
|
int |
getResolution()
Auflösung ermitteln.
|
int |
getWidth(String s)
Breite des Textes ermitteln.
|
static void |
main(String[] args)
Test-Methode.
|
void |
print(String s)
Test ausgeben.
|
void |
println()
Zeilenumbruch ausgeben.
|
void |
println(String s)
Text mit Zeilenumbruch ausgeben.
|
void |
refreshFont()
Zeichensatz einstellen.
|
void |
resetImage()
Image zurücksetzen.
|
void |
resetImages()
Alle Images zurücksetzen.
|
void |
saveImage()
Aktuelles Bild speichern.
|
protected void |
saveImage(String fn)
Aktuelles Bild mit aktueller Auflösung speichern.
|
static void |
saveImage(String fn,
BufferedImage img)
Bild mit Standardauflösung speichern.
|
protected static void |
saveImage(String fn,
BufferedImage img,
int resolution)
Bild mit bestimmter Auflösung speichern.
|
void |
setAntialiasing(boolean antialiasing)
Vorgeben, ob Antialiasing verwendet werden soll.
|
void |
setBackground(Color c)
Aktuelle Hintergrundfarbe vorgeben.
|
void |
setBorderBottom(int bottom)
Größe des unteren Randes vorgeben.
|
void |
setBorderLeft(int left)
Größe des linken Randes vorgeben.
|
void |
setBorderRight(int right)
Größe des rechten Randes vorgeben.
|
void |
setBorderTop(int top)
Größe des oberen Randes vorgeben.
|
void |
setColor(Color c)
Aktuelle Farbe vorgeben.
|
void |
setCurX(int x)
Aktuelle X-Position vorgeben.
|
void |
setCurY(int y)
Aktuelle Y-Position vorgeben.
|
void |
setFileName(String fn)
Aktuellen Dateinamen vorgeben.
|
void |
setFontName(String fontname)
Zeichsatzname vorgeben.
|
void |
setFontSize(int fontsize)
Aktuelle Zeichsatzgröße vorgeben.
|
void |
setFontStyle(int fontstyle)
Style vorgeben.
|
void |
setFontStyleIndex(int i)
Style per Index vorgeben.
|
void |
setImage(BufferedImage img)
Image vorgeben.
|
void |
setImageHeight(int height)
Bildhöhe vorgeben.
|
void |
setImageType(int imagetype)
Bildtyp vorgeben.
|
void |
setImageTypeIndex(int i)
Bildtyp per Index setzen.
|
void |
setImageWidth(int width)
Bildbreite vorgeben.
|
void |
setPage(int page)
Aktuelle Seite vorgeben.
|
void |
setResolution(int res)
Auflösung setzen.
|
protected static final String STDFILENAME
protected BufferedImage myImage
protected ImageRenderer()
public ImageRenderer(String fn)
fn - Dateinamepublic ImageRenderer cloneIR()
public void setImageWidth(int width)
width - Bildbreitepublic int getImageWidth()
public void setImageHeight(int height)
height - Bildhöhepublic int getImageHeight()
public void setBorderLeft(int left)
left - Größe des linken Randespublic int getBorderLeft()
public void setBorderRight(int right)
right - Größe des rechten Randespublic int getBorderRight()
public void setBorderTop(int top)
top - Größe des oberen Randespublic int getBorderTop()
public void setBorderBottom(int bottom)
bottom - Größe des unteren Randespublic int getBorderBottom()
public void setImageType(int imagetype)
imagetype - Bildtyppublic int getImageType()
public void setImageTypeIndex(int i)
i - Indexpublic int getImageTypeIndex()
public void setFontName(String fontname)
fontname - Zeichsatznamepublic String getFontName()
public void setFontStyle(int fontstyle)
fontstyle - Stylepublic int getFontStyle()
public void setFontStyleIndex(int i)
i - Indexpublic int getFontStyleIndex()
public void setFontSize(int fontsize)
fontsize - aktuelle Zeichsatzgrößepublic int getFontSize()
public void setAntialiasing(boolean antialiasing)
antialiasing - true: ja, false: neinpublic boolean getAntialiasing()
public void setFileName(String fn)
fn - aktueller Dateinamepublic String getFileName()
public void setPage(int page)
page - aktuelle Seitepublic void setCurX(int x)
x - aktuelle X-Positionpublic int getCurX()
public void setCurY(int y)
y - aktuelle Y-Positionpublic int getCurY()
public int getPage()
public BufferedImage getImage()
public Vector getImages()
public int getResolution()
public void setResolution(int res)
res - Auflösung in DPIpublic void refreshFont()
public void resetImage()
public void resetImages()
public void setImage(BufferedImage img)
img - Imageprotected static void saveImage(String fn, BufferedImage img, int resolution) throws Exception
fn - Dateinameimg - das Bildresolution - Auflösung in DPIException - im Fehlerfallpublic static void saveImage(String fn, BufferedImage img) throws Exception
fn - Dateinameimg - das BildException - im Fehlerfallprotected void saveImage(String fn) throws Exception
fn - DateinameException - im Fehlerfallpublic void saveImage()
throws Exception
Exception - im Fehlerfallpublic void flush()
throws Exception
Exception - im Fehlerfall (insbesondere beim Speichern eines Bildes)public void println()
throws Exception
Exception - im Fehlerfall (insbesondere beim Speichern eines Bildes)public void print(String s) throws Exception
s - TextException - im Fehlerfall (insbesondere beim Speichern eines Bildes)public void println(String s) throws Exception
s - TextException - im Fehlerfall (insbesondere beim Speichern eines Bildes)public int getWidth(String s)
s - Textpublic int getHeight()
public int getAscent()
public Color getColor()
public void setColor(Color c)
c - Aktuelle Farbepublic Color getBackground()
public void setBackground(Color c)
c - Aktuelle Hintergrundfarbepublic void drawLine(int x1,
int y1,
int x2,
int y2)
x1 - X1y1 - Y1x2 - X3y2 - Y3public void drawRectWH(int x,
int y,
int width,
int height)
x - X-Starty - Y-Staerwidth - Breiteheight - Höhepublic void fillRect(int x,
int y,
int dx,
int dy)
x - Xy - Ydx - DXdy - DYpublic void clearRect(int x,
int y,
int dx,
int dy)
x - Xy - Ydx - DXdy - DYpublic void drawPolygon(int[] xx,
int[] yy,
int n)
xx - X-Koordinatenyy - Y-Koordinatenn - Anzahl der Punktepublic void fillPolygon(int[] xx,
int[] yy,
int n)
xx - X-Koordinatenyy - Y-Koordinatenn - Anzahl der Punktepublic void drawOval(int x,
int y,
int dx,
int dy)
x - Xy - Ydx - DXdy - DYpublic void fillOval(int x,
int y,
int dx,
int dy)
x - Xy - Ydx - DXdy - DYpublic void drawImage(Image img, int x, int y)
img - das Bildx - Xy - Ypublic void drawImageCenter(Image img, int x, int y, int dx, int dy)
img - das Bildx - Xy - Ydx - DXdy - DYpublic void drawImageZoom(Image img, int x, int y, int dx, int dy)
img - das Bildx - Xy - Ydx - DXdy - DYpublic static void main(String[] args)
args - KommandozeilenparameterCopyright © 2005-2023–2024 >StA-Soft<. All rights reserved.