java.awt.Graphics底层设备的高度?

发布于 2024-12-25 09:56:03 字数 131 浏览 2 评论 0原文

我正在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

·深蓝 2025-01-01 09:56:03

我可以只将 BufferedImage.createGraphics 结果传递给我的绘图函数吗?

我建议传递:

  1. BufferedImage 本身或
  2. Graphics 实例和 Dimension (除非绘图需要高度,而不是 WxH - 然后使用一个int)。

Can I do this passing only BufferedImage.createGraphics result to my drawing function?

I recommend to pass either:

  1. The BufferedImage itself or
  2. The Graphics instance and a Dimension (unless the plot only requires height, as opposed to WxH - then use an int).
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文