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)

1  
static void fillTriangle(BufferedImage image, int x1, int y1, int x2, int y2, int x3, int y3, Color color) {
2  
  Graphics2D g = imageGraphics(image);
3  
  g.setColor(color);
4  
  g.fillPolygon(intArray(x1, x2, x3), intArray(y1, y2, y3), 3);
5  
  g.dispose();
6  
}
7  
8  
// draw on currentImage()
9  
static void fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3, Color color) {
10  
  fillTriangle(currentImage(), x1, y1, x2, y2, x3, y3, color);
11  
}
12  
13  
static void fillTriangle(Pt a, Pt b, Pt c, Color color) {
14  
  fillTriangle(a.x, a.y, b.x, b.y, c.x, c.y, color);
15  
}

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: 462 / 497
Version history: 4 change(s)
Referenced in: [show references]