How to color a pixel?

后端 未结 4 1914
心在旅途
心在旅途 2020-12-09 11:21

I have to create a simple 2D animation without using various primitives for drawing line, circle etc for the purpose. It has to be done by manipulating pixels and implementi

4条回答
  •  孤城傲影
    2020-12-09 12:07

    The class java.awt.BufferedImage has a method setRGB(int x, int y, int rgb) which sets the color of an individual pixel. Additionally, you might want to look at java.awt.Color, especially its getRGB() method, which can convert Colors into integers that you can put into the int rgb parameter of setRGB.

提交回复
热议问题