PDA

View Full Version : Printing RGB datas into widget



agsrinivasan
7th February 2007, 07:49
hi everyone,
i am using qt-embedded 3.3.5.I want to display RGB datas into my widget..
i had read the Bmp image (600x800) and skipped the header(54 Bytes) details and store that datas into an tempPixelData..
first of all i had displayed only first 10 lines and displayed the RGB datas using pixel,QRgb and QPainter....

But I am getting only Red color in that first 10 lines....

is it correct?

please let me know..

I had attached the code and also Output screen shot..


regards,

srini

ChristianEhrlicher
7th February 2007, 08:00
- why do you want to do it that way and don't use QImage?
- see also
http://www.qtcentre.org/forum/f-qt-programming-2/t-qimage-issue-5478.html
http://www.qtcentre.org/forum/f-qt-programming-2/t-problem-with-setpixel-5477.html
http://www.qtcentre.org/forum/f-qt-programming-2/t-how-to-read-and-display-bmp-image-using-qt-5401.html
-> when you want to access the bmp directly (I can't think of any situation where this is really needed) you have to *know* the bmp format and can't simply access the bits like you think they're arranged

agsrinivasan
7th February 2007, 09:48
Thanks for your reply,
Now i have to read only RGB datas and display it pixel by pixel into an widget. which QT class i have to use?

regards..
srini

ChristianEhrlicher
7th February 2007, 09:53
When it's really rgb data, your approach is correct (I would maybe use a QImage with setPixel and the paint the QImage to my widget). But because you see only red color, I assume that's not only rgb data but coded in another way - and as I said in the other threads - you have to know the structure of the data you want to display.

agsrinivasan
7th February 2007, 10:06
I just printed the RGB datas in my Terminal....i got these
temppixel data array :rsrts\u251c
\u23bd
± \u2524
±
°

\u240c
]
TKFS_
\u23bc

\u2265\u2500\u23ba\u23bapvz}}[V
N
.&%"0/ E
#
(
-49=<>BGIH
E ]!Z X S!P!N$L$LY
^°j
s#n!fdl jkm%
z\uffff

Regards,,,
srini