Archived

This topic is now archived and is closed to further replies.

AronBrown

[java] What is the fastest way to draw a single pixel?

Recommended Posts

I am making a particle enine now and I need a fast way to draw pixels. I am currently using g.drawLine(x, y, x+1, y+1) right now. Is there a better way?

Share this post


Link to post
Share on other sites
I think fillRect(x, y, 1, 1) might be a very small amount faster, but not much.

If you're using an offscreen buffer then it might be fast to get the raster data from your buffer and set the color values yourself, but I'm not sure because I haven't played around with that for quite a while.

"So crucify the ego, before it's far too late. To leave behind this place so negative and blind and cynical, and you will come to find that we are all one mind. Capable of all that's imagined and all conceivable."
- Tool



Edited by - wayfarerx on October 30, 2001 1:05:30 PM

Share this post


Link to post
Share on other sites