• Post Reply Bookmark Topic Watch Topic
  • New Topic

drawPixel  RSS feed

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, there is no such method (that I could find). I want to make an image pixel by pixel for the cellular automata game of Life. I looked in the graphics class where drawLine and drawOval live, hoping to find drawPixel or setPixel, but could not find anything like that. I suppose I could draw a line from a point to the same point, but that seems wasteful.

Is there a setPixel method somewhere?
 
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There isn't - drawLine is the way to go. If you were creating a BufferedImage (and then drawing that onto the Graphics object) you could use the setRGB(x,y,rgb) method.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!