[英]How to get the colour of a applet viewer pixel in Java?
I have drawn any picture, used Graphics 2D. 我已经绘制了任何图片,使用了Graphics 2D。 How do I get the colour of a pixel at x, y?
如何获得x,y处像素的颜色? getPixelColor don't work, because this method get pixel from screen, not applet viewer coordinates.
getPixelColor不起作用,因为此方法从屏幕而不是applet查看器坐标获取像素。
Graphics
of a BufferedImage
BufferedImage
的Graphics
上 Graphics2D
. Graphics2D
。 BufferedImage.getRGB(x,y)
or variants (check the docs.). BufferedImage.getRGB(x,y)
或变体(请检查文档。)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.