ts-7000
[Top] [All Lists]

[ts-7000] ts-7390 Qt gradient background help needed

To:
Subject: [ts-7000] ts-7390 Qt gradient background help needed
From: "jasonpenn_1981" <>
Date: Mon, 15 Aug 2011 22:20:20 -0000
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/

<Prev in Thread] Current Thread [Next in Thread>
  • [ts-7000] ts-7390 Qt gradient background help needed, jasonpenn_1981 <=
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU