Convertion of a Java BufferedImage to a QImage #146
-
Apparently on the old qtjambi.info site there a page describing how to do this, but that site seems to have gone away. Anyone have any pointers as to how to do this? |
Beta Was this translation helpful? Give feedback.
Answered by
omix
Apr 26, 2023
Replies: 1 comment
-
That's easy: // import java.io.*;
// import javax.imageio.*;
RenderedImage jImage = ...
ByteArrayOutputStream output = new ByteArrayOutputStream();
ImageIO.write(jImage, "png", output);
QPixmap pixmap = new QPixmap();
pixmap.loadFromData(output.toByteArray(), "png");
QImage qImage = pixmap.toImage(): |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
omix
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's easy: