Libraryless. Click here for Pure Java version (4664L/26K).
static void drawLine(BufferedImage image, int x1, int y1, int x2, int y2, Color color) { drawLine(imageGraphics(image), x1, y1, x2, y2, color); } static void drawLine(Graphics2D g, int x1, int y1, int x2, int y2, Color color) { g.setColor(color); g.drawLine(x1, y1, x2, y2); } static void drawLine(BufferedImage image, Pt a, Pt b, Color color) { drawLine(imageGraphics(image), a, b, color); } static void drawLine(Graphics2D g, Pt a, Pt b, Color color) { drawLine(g, a.x, a.y, b.x, b.y, color); } ifclass DoubleEdge import java.awt.geom.Line2D; static void drawLine(Graphics2D g, DoubleEdge e, Color color) { if (e == null) ret; g.setColor(color); g.draw(new Line2D.Double(e.x1(), e.y1(), e.x2(), e.y2())); } endif
Began life as a copy of #1006925
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx
No comments. add comment
Snippet ID: | #1031936 |
Snippet name: | drawLine |
Eternal ID of this version: | #1031936/6 |
Text MD5: | d2b7d2b54ac52b921d89139f80c8f6a1 |
Transpilation MD5: | 381dabf65ea05768223f3a7494156ac8 |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-01-01 21:02:20 |
Source code size: | 760 bytes / 26 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 196 / 260 |
Version history: | 5 change(s) |
Referenced in: | [show references] |