Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

17
LINES

< > BotCompany Repo | #1006925 // drawRoundEdgeLine

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2816L/17K).

static void drawRoundEdgeLine(BufferedImage image, int x1, int y1, int x2, int y2, Color color, double width) {
  drawRoundEdgeLine(imageGraphics(image), x1, y1, x2, y2, color, width);
}

static void drawRoundEdgeLine(Graphics2D g, int x1, int y1, int x2, int y2, Color color, double width) {
  g.setColor(color);
  g.setStroke(new BasicStroke((float) width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER));
  g.drawLine(x1, y1, x2, y2);
}

static void drawRoundEdgeLine(BufferedImage image, Pt a, Pt b, Color color, double width) {
  drawRoundEdgeLine(imageGraphics(image), a, b, color, width);
}

static void drawRoundEdgeLine(Graphics2D g, Pt a, Pt b, Color color, double width) {
  drawRoundEdgeLine(g, a.x, a.y, b.x, b.y, color, width);
}

Author comment

Began life as a copy of #1006921

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006925
Snippet name: drawRoundEdgeLine
Eternal ID of this version: #1006925/10
Text MD5: 75284d624fd69fc240a2b0971027ae76
Transpilation MD5: 5ddc843b72347003edab148e65448e5f
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-01-07 18:43:43
Source code size: 759 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 508 / 592
Version history: 9 change(s)
Referenced in: [show references]