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

7
LINES

< > BotCompany Repo | #1019585 // drawBox - draws AROUND the rectangle (e.g. to outline a found segment)

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

Libraryless. Click here for Pure Java version (248L/2K).

1  
static void drawBox(BufferedImage image, Rect r, Color color, double opaqueness) {
2  
  if (r == null) ret;
3  
  Graphics2D g = image.createGraphics();
4  
  g.setColor(colorWithAlpha(color, opaqueness));
5  
  g.drawRect(r.x-1, r.y-1, r.w+2, r.h+2);
6  
  g.dispose();
7  
}

Author comment

Began life as a copy of #1004268

download  show line numbers  debug dex  old transpilations   

Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019585
Snippet name: drawBox - draws AROUND the rectangle (e.g. to outline a found segment)
Eternal ID of this version: #1019585/3
Text MD5: 6de1d23720e1502e6c66be16379b3d25
Transpilation MD5: 716b01f46cbc636c88cc1c76b1033df7
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-08 08:03:46
Source code size: 259 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 250 / 344
Version history: 2 change(s)
Referenced in: [show references]