Skip to content

Convertion of a Java BufferedImage to a QImage #146

Closed Answered by omix
DavidGoodenough asked this question in Q&A
Discussion options

You must be logged in to vote

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():

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by omix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants