开发者

How do i get pixel data of an AWT component?

开发者 https://www.devze.com 2023-01-29 16:46 出处:网络
I have a JLabel component to which i write some text. I want to decode it to pixe开发者_运维问答l array and send it via RS-232 interface to some external appliance.

I have a JLabel component to which i write some text. I want to decode it to pixe开发者_运维问答l array and send it via RS-232 interface to some external appliance.

How can i access pixels of Component or Graphics objects?


Using Robot is one way. Here is another way.

Robot is fine for most needs, better for some, but the advantage of the second way is that it can be done even in a sand-boxed app.


Use Robot class. Here's an example how to create a screenshot with it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号