Oberflächen
  Themen     Download     DBS     Sprachen     File Formats     Impressum     Datenschutz  
Elektrotechnik Swing
Elektrotechnik WPF
C#- GUI-Programme mit Quellcode
Java-Programme mit Quellcode
C#
WPF
HTML
Java FX
Java (Swing)
Winforms
Visual Studio (MFC)
ArcView
QGis
ArcView .net
IDW
Allgemein:
Startseite
Vorlesungen
Labore
Sinnvolle Programme
Lineare Regression
GUI-Entwurfsarbeit
Single-Format
Design Pattern-Termine
Observer1
Bsp2
Json-Array
Json-Dialogelemente
Webtechnologien

Canvas-Snippet

Canvas canvas = new Canvas(500,500);
root.setCenter(canvas);

GraphicsContext gc = canvas.getGraphicsContext2D();
gc.setFill(Color.BLUE);
gc.fillRect(75,75,100,100);

Anfang / Ende:
void beginPath()
void closePath()
void stroke() // ende des Path
Zeichenmethoden:
void lineTo(double x1, double y1)
void moveTo(double x0, double y0)
void strokeLine(double x1, double y1, double x2, double y2)
void strokeOval(double x, double y, double w, double h)
void strokePolygon(double[] xPoints, double[] yPoints, int nPoints)
void strokePolyline(double[] xPoints, double[] yPoints, int nPoints)
void strokeRect(double x, double y, double w, double h)
void strokeRoundRect(double x, double y, double w, double h, double arcWidth, double arcHeight)
void bezierCurveTo(double xc1, double yc1, double xc2, double yc2, double x1, double y1)

void clearRect(double x, double y, double w, double h)
void setLineDashes(double... dashes)
void setLineWidth(double lw)
Color:
setStroke(Color.RED)
setFill( Color.BLUE )
-Color.BLACK / Color.RED
-Color.rgb(230, 230, 230)
-Color.web("0x5555FF",1.0)

Fillfunktionen
void fillOval(double x, double y, double w, double h)
void fillPolygon(double[] xPoints, double[] yPoints, int nPoints)
void fillRect(double x, double y, double w, double h)
void fillRoundRect(double x, double y, double w, double h, double arcWidth, double arcHeight)
Textfunktionen
void strokeText(String text, double x, double y)
void strokeText(String text, double x, double y, double maxWidth)
void fillText(String text, double x, double y)
void fillText(String text, double x, double y, double maxWidth)
void setTextAlign(TextAlignment align)
void setTextBaseline(VPos baseline)

Textlänge, Texthöhe
o javafx.geometry.Bounds
o Bounds bounds = TextBuilder.create().text(text).font(font).build().getLayoutBounds();
o double width=bounds.getWidth();
o double height=bounds.getHeight();


Canvas
ChangeListener-Snippet