![](smile.gif)
🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Java Demos
Hi everyone,
I am trying to program a little 2d application in java, just something that plots pixels to a screen. I want to recreate my good ol days with the spinning cubes, but I am unsure about how I should plot pixels in an efficient manner, I know about the Point2D class, but I would like to know, is there a better way of doing this.
If you know anything that can help me
please do tell me
thanks
Kosh
![](smile.gif)
If you are using an applet, just override the Paint() function. It will pass a Graphics object to the function which you can use to draw with. I know there is something for drawing a single pixel (which is SLOW) but you can simulate that with a DrawLine() function with the same beginning and end points.
If you need to draw points efficiently, there is a special type of Image which takes an array of bytes and create an image of it. If you pass the same array of the same size over and over again, I think it won''t continually create new Images, but reuse the first one.
If you need to draw points efficiently, there is a special type of Image which takes an array of bytes and create an image of it. If you pass the same array of the same size over and over again, I think it won''t continually create new Images, but reuse the first one.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement