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

  • Home
  • SEARCH
  • 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 549369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:10:38+00:00 2026-05-13T11:10:38+00:00

I am building a QT GUI application and use QImage for opening images. My

  • 0

I am building a QT GUI application and use QImage for opening images.
My problem is that I can’t figure out how to use QImage’s bit() and scanline()
methods to get access at per pixel level.

I’ve seen this post Qt QImage pixel manipulation problems
but this is only for the first pixel of each row. Is this correct or I got it all wrong?

thanks in advance

  • 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-13T11:10:38+00:00Added an answer on May 13, 2026 at 11:10 am

    The scanlines correspond to the the height of image, the columns correspond to the width of the image.

    According to the docs, the prototype looks like uchar* QImage::scanline(int i), or a similar const version.

    But, as a commenter pointed out, because the data is dependent on the machine architecture and image, you should NOT use the uchar * directly. Instead, use something like the following:

    QRgb *rowData = (QRgb*)img.scanLine(row);
    QRgb pixelData = rowData[col];
    int red = qRed(pixelData);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After building the application GUI, I realised it was a little bit too complex
I'm building a Java application with a Swing GUI and a task that takes
I am building a simple wpf application. The gui has a button, that when
I am building a small php application that simply extracts an XML string out
I'm currently building a Java GUI application and I'm about to implement something that
I'm building a gui component that has a tree-based data model (e.g. folder structure
Part of the GUI I'm building using tkinter has a pop-up window that says
Building an application with a database that has the ability to get big not
I'm building from scratch a web application that is not trivial (have some algorithms
I'm building an application for a linux platform in C, with a GTK+2 GUI.

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.