Skip to main content

putPixel Function

2 replies [Last post]
egokrypt
Offline
Joined: 2007-01-20

I seriously dont know if a function exists in Graphics2D or Graphics class which simply puts a pixel of color 'col' at (x,y).

It would be nice to have one, cuz right now, i am forced to use the line function from x,y to x,y....sad....

putPixel(x,y,color)

Anybody knows of such a function already ?
Or if its too silly, dont bother...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
campbell
Offline
Joined: 2003-06-24

Please refer to this thread:
http://forums.java.net/jive/thread.jspa?messageID=111831&tstart=0

The summary: no, such a method will not be added. And don't use drawLine() for this; fillRect(x, y, 1, 1) is a better choice.

Chris
Java 2D Team

egokrypt
Offline
Joined: 2007-01-20

wow.... thanks a lot dude... that thread makes a lot of sense.