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

15
LINES

< > BotCompany Repo | #1006920 // fillTriangle - works on BufferedImage

JavaX fragment (include)

static void fillTriangle(BufferedImage image, int x1, int y1, int x2, int y2, int x3, int y3, Color color) {
  Graphics2D g = imageGraphics(image);
  g.setColor(color);
  g.fillPolygon(intArray(x1, x2, x3), intArray(y1, y2, y3), 3);
  g.dispose();
}

// draw on currentImage()
static void fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3, Color color) {
  fillTriangle(currentImage(), x1, y1, x2, y2, x3, y3, color);
}

static void fillTriangle(Pt a, Pt b, Pt c, Color color) {
  fillTriangle(a.x, a.y, b.x, b.y, c.x, c.y, color);
}

Author comment

Began life as a copy of #1004268

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: #1006920
Snippet name: fillTriangle - works on BufferedImage
Eternal ID of this version: #1006920/5
Text MD5: 2356b32f9255ca650f219e0fa6780e6c
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-07-05 17:59:16
Source code size: 559 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 408 / 439
Version history: 4 change(s)
Referenced in: [show references]