[Qt-interest] Color changing API for the QImage

trinathpujari trinathpujari at tataelxsi.co.in
Fri Apr 30 07:56:38 CEST 2010


Thanks for your earliest reply..............

Regards
 Trinath


Ramesh wrote:
> I m sorry,
> In my previous mail, I hv done small mistake..
> Here s the updated one..
>
>   const bool sel((option.state & QStyle::State_Selected) ==
> QStyle::State_Selected);
> 	        QBrush baseBrush(sel ? option.palette.highlight() :
> option.palette.base());
> 	        QBrush textBrush(sel ? option.palette.highlightedText() :
> option.palette.text());
>
> painter->setBrush(baseBrush);
>
>
>
> -----Original Message-----
> From: Ramesh [mailto:ramesh.bs at robosoftin.com]
> Sent: Friday, April 30, 2010 11:15 AM
> To: 'trinathpujari'; 'qt-embedded-interest at trolltech.com'; 'Qt-interest'
> Subject: RE: [Qt-interest] Color changing API for the QImage
>
> In the paint event, u need to set the selection color from pallete..
>
> QPainter paint(this);
> pen = QApplication::palette().highlight().color();
> paint.setPen(pen);
> paint.drawpixmap(...);...
>
>
>
>
>
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com
> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of trinathpujari
> Sent: Friday, April 30, 2010 10:49 AM
> To: qt-embedded-interest at trolltech.com; Qt-interest
> Subject: [Qt-interest] Color changing API for the QImage
>
>
>   Hi All,
>
>
>   *The QImage background color is purple and text color is black. If I
>   select that image then the backgroundcolor has to be changed to black
>   and foreground color to become purple color. *
>
>
>   *    I tried using checking each pixel value as if its black then i
>   set purple and vice versa...But in such case text becoming distorted
>   (here purple background is example that can be any color)....*
>
> Can anybody tell what API can i use for the above implementation to work.
>
> Thanks in Advance.........
>
> Regards
>  Trinath
>
>
>
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
> -----------------------------------------------
> Robosoft Technologies - Come home to Technology
>
> Disclaimer: This email may contain confidential material. If you were not an intended recipient, please notify the sender and delete all copies. Emails to and from our network may be logged and monitored. This email and its attachments are scanned for virus by our scanners and are believed to be safe. However, no warranty is given that this email is free of malicious content or virus.
>
>   







More information about the Qt-interest-old mailing list