[Qt-interest] How to show Mono8 images?

Albert Graells Rovira txandi at gmail.com
Wed Jul 28 13:20:54 CEST 2010


Hi,

To work with gray images:

Create a QImage (sharing the data buffer) and set the format to QImage::
Format_Indexed8. Then, apply a color table to this QImage (with
setColorTable). The table must have 256 elements and the N_th element of the
table should be equal to qRgb(N,N,N). The same technique should work for
8bit mono images.

Regards,



2010/7/28 董隆超 <donglongchao at 163.com>

>
>
>
>
> >董隆超 schrieb:
> >> Hi,
> >>
> >> I am trying to show images from CCD with Mono8(8 bits per pixel)
> >> format .But I find QT only support Mono(1 bit per pixel) adn MonoLSB(1
> >> bit per pixel).
> >> So is there a way to show them?
> >> Thans a lot.
> >I would be also really interested in such a grayscale format. I am using
> >a mono camera and convert the buffer to a different buffer in rgb
> >format, so that I can use it with QImage directly. But this is time
> >consuming and should not be necessary.
> >
> >Matthias
>
> I also try to convert it into RGB32 format and it works well except time and CPU problem.I think QT may need to support such format.It is not a hard work for them.Or may be there is some special way we do not know to handle Mono8.:)
>
> Longchao
>
>
>
> ------------------------------
> 网易邮箱,没有垃圾邮件的邮箱。 <http://mail.163.com/?from=fe1>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>


-- 
albert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100728/54e22af2/attachment.html 


More information about the Qt-interest-old mailing list