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)

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

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: 515 / 516
Referenced in: [show references]