[Qt-interest] How to render text on Image with different color???
trinathpujari
trinathpujari at tataelxsi.co.in
Wed May 5 07:50:25 CEST 2010
Robert Hairgrove wrote:
> trinathpujari wrote:
>
>> Hi All,
>>
>> I have text drawn on QImage. Now i want to change back ground
>> color as black and text as some other color(selected).I am checking each
>> pixel color and updating the pixel color. But text is becoming distorted.
>> Alternative to this i did invert pixel at that time text is coming
>> properly but Back ground is different(Not black which i wanted).
>> Please help me to resolve this.
>>
>
> Wouldn't it be easier (and possibly faster) to just erase the entire
> background and redraw the text?
>
> The default behaviour for drawing text with QPainter is with
> antialiasing on. Antialiasing blends the edges of the text with the
> background color to provide a smoother perception (i.e. less jagged
> edges). If you need to change the image pixel by pixel, you will
> probably want to turn this off by setting the appropriate property of
> the QFont object before drawing the text (see documentation for the
> QPainter class for details).
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> Hi Robert,
Actually I am creating that QImage at starting and drawing
text on it. After that i am selecting some portion only for that
reverting background color to black and foreground color with some other
color. I checked with setting Anti Aliasing text to false still no affect.
Help to resolve this.
Thanks and Regards,
Trinath
More information about the Qt-interest-old
mailing list