When I tell QT I want it to display a gradient from white to half way to black
from the top to the bottom of the display I get a rather banded looking
background. In the style sheet I ask for this:
QDialog {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #ffffff,
stop: 1 #777777);
}
Given this hardware's rgb565 hardware, I think this behavior makes sense when
it displays about 16 distinct bands of gray. Unfortunately a banded gradient
doesn't look as nice as a smoother one. Googling leads me to believe that one
way to get a smooth gradient is by loading an image file as the background
where the image is dithered to smooth out the transitions between shades of
gray. Thus far I haven't gotten what I want using a dithered background image
in the style sheet like this:
QDialog {
background-image: url(:/images/back_gradient.png);
}
I attempted to make a suitable .png by using ffmpeg to convert from a 24 bit
gradient to rgb565 then converting the apparently dithered rgb565 image back to
.png so Qt can load it. I got a banded gradient or no gradient at all from my
attempts.
Another technique I found referred to creating the dithered gradient image at
run time. I don't know how to accomplish that.
My hope is one of you knows how to get a smooth gradient background and can
help me.
Thanks.
--
Jason
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|