How to best serialize a java.awt.Image?

前端 未结 3 1303
梦谈多话
梦谈多话 2020-12-18 23:43

I have a Serializable object which is supposed to hold a java.awt.Image as its member. How should I go about serializing it? (Edited from a not so clear first version, s

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-19 00:23

    None that I know of. I believe you need to write your own serializer for it to basically save out the width, height and pixel values... Or write it out to the stream as a PNG or something

提交回复
热议问题