Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7665319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:32:03+00:00 2026-05-31T14:32:03+00:00

I have a C++ Open GL application that renders an animation display, and captures

  • 0

I have a C++ Open GL application that renders an animation display, and captures the frame-buffer contents using glReadPixels(), which is then stored as a 1D char array.

I can get the buffer contents and save it to a char array, as follow:

char * values = (char *) malloc(width * height * 4 * sizeof(char));
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, values);

I then send these raw data over the network using socket, which is not an issue for me.
I have a Qt Desktop Client (which communicates with the OpenGL application using socket)

This client program can successfully receive the raw binary data sent by the Open GL application.

How can I render an image from these binary data in my client application?
Does Qt has any built-in function / library to draw an image from binary data (which is generated from glReadPixels)?

Do I need to encode / decode these raw binary data as base64 type prior to send them via sockets? Why or why not?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T14:32:05+00:00Added an answer on May 31, 2026 at 2:32 pm

    QImage has a nice constructor that takes an existing buffer, a width, a height and a pixel format. That seems like an excellent place to start.

    And if you create the QImage on the server, you can use Qt’s built-in streaming to send a QImage to your clients (QDataStreams can wrap just about any IO device, including network sockets), so there’s no need to do any encoding and decoding yourself – Qt will take care of everything for you.

    Hope that helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Open GL application that renders a simulation animation and outputs several
I have made an application that gives the user the option to open up
I have a general question that is rather open-ended (i.e. depends on platform, application
I am developing android application in which i have to open option menu from
I have a 64 bit Enterprice SuSE 11 I have an application which open
I have a console application which can also open winform under certain conditions.Processing(its a
We have an application using the IBM Informix driver. Whenever we try to open
Possible Duplicate: How to open-source an application that uses API keys I have an
I have a Silverlight 4 application from which I'm attempting to display a PDF.
We have an application that produces HTML documents which the user opens in word

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.