如何消除通过将 jframe 图像捕获到文件而产生的边框?
因此,我制作了一个应用程序,可以从 csv 文件创建图形时间线。我现在已经完成了那部分,我只需要帮助让图像变得“漂亮”。捕获图像时,JFrame 的边框也会被捕获! 如何使边界不被捕获?或者我如何摆脱它并保持图像大小?
So I made an application that creates a graphical timeline from a csv file. I have that part finished now I just need help getting the image "pretty". When capturing the image the border from the JFrame is captured too! How do I make it such that the border is not captured? Or how do I get rid of it and keep the image size?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个简单的例子。只是为了澄清您的需求。基于解决方案如何删除JFrame 屏幕截图的标题栏?。
以下程序截取其 JFrame 的屏幕截图并将其写入文件。
这是您想要的吗,if_zero_equals_one?如果没有,也许您可以在您的问题中添加一些代码,以尝试执行您想要的操作。
PS感谢 Darien 和 camickr ,谁指出了在哪里可以找到该来源
例子。
也许这应该是一个评论。但这样的格式就更清晰了。
Here is a simple example. Just to clarify your needs. Based on solution of How to remove the title bar from a JFrame Screenshot?.
The following program takes screenshot of its JFrame and writes it to the file.
Does this what you want, if_zero_equals_one? If not, maybe you could add some code to your question, that tries to do what you want.
P.S. Thanks to Darien and camickr, who pointed where to find the source for that
example.
Maybe this should be a comment. But it's clearer with such formatting.
我相信这就是我一直在寻找的东西。
This is what I believe I was looking for.