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

7
LINES

< > BotCompany Repo | #1004268 // drawBoxes - draws AROUND the rectangles (e.g. to outline a found segment)

JavaX fragment (include)

1  
static void drawBoxes(BufferedImage image, L<Rectangle> boxes, Color color, float opaqueness) {
2  
  Graphics2D g = image.createGraphics();
3  
  g.setColor(colorWithAlpha(color, opaqueness));
4  
  for (Rectangle r : boxes)
5  
    g.drawRect(r.x-1, r.y-1, r.width+2, r.height+2);
6  
  g.dispose();
7  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1004268
Snippet name: drawBoxes - draws AROUND the rectangles (e.g. to outline a found segment)
Eternal ID of this version: #1004268/1
Text MD5: 90671d77d29f37301e80f434fa335b22
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-12 14:33:11
Source code size: 289 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 605 / 611
Referenced in: [show references]