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

16
LINES

< > BotCompany Repo | #1035414 // drawPixel - also works with translucent colors

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

Transpiled version (7932L) is out of date.

svoid drawPixel(BufferedImage image, int x, int y, Color color) {
  drawPixel(imageGraphics(image), x, y, color);
}

svoid drawPixel(Graphics2D g, int x, int y, Color color) {
  g.setColor(color);
  g.drawLine(x, y, x, y);
}

svoid drawPixel(BufferedImage image, Pt p, Color color) {
  drawPixel(image, p.x, p.y, color);
}

svoid drawPixel(Graphics2D g, Pt p, Color color) {
  drawPixel(g, p.x, p.y, color);
}

Author comment

Began life as a copy of #1031936

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035414
Snippet name: drawPixel - also works with translucent colors
Eternal ID of this version: #1035414/3
Text MD5: f51c39c3aab627f93572cc11d51acf71
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-05-06 17:27:36
Source code size: 424 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 114 / 159
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)