java.awt.Graphics底层设备的高度?
我正在 BufferedImage 上绘制直方图(自定义数据,与着色无关)。我想让它尽可能宽和高。我可以只将 BufferedImage.createGraphics 结果传递给我的绘图函数吗?我找不到如何通过 Graphics 实例获取图像尺寸。
I'm drawing a histogram (custom data, not related to coloring) on an BufferedImage. And I'd like to make it as wide and tall as possible. Can I do this passing only BufferedImage.createGraphics result to my drawing function? I can't find how to obtain image dimensions through an instance of Graphics.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议传递:
Dimension
(除非绘图仅需要高度,而不是 WxH - 然后使用一个int
)。I recommend to pass either:
BufferedImage
itself orGraphics
instance and aDimension
(unless the plot only requires height, as opposed to WxH - then use anint
).