Hi
I need to draw something like this (see picture). I don't know, what to make good use - blured lines or gradient or something else![]()
Please, help me
Hi
I need to draw something like this (see picture). I don't know, what to make good use - blured lines or gradient or something else![]()
Please, help me
The easiest way would be to use a linear gradients in combination with painter opacity for the shadow edges.
You could look at the Gradients example in the Qt Demos. It is not exactly what you need, but you should find something in there.
Regards.
Try the attached example (it works for backgroundless pixmaps as well and with little effort it should work for semi-transparent ones too). Use right and left mouse button to switch between different drawing modes.
If you want to change the way the shadow looks, adjust the filter.
Here is an improved version. Optimised and working correctly for full alpha channeled images.
This is very very slow.
There was some shadows example on Trolltech labs(Graphics/Dojo)
You can find it here
Thank you for concern.
This example is rendering SVGs. But I want image files to be rendered with shadow. The old one, provided by Wysota, is doing same but that is too slow to be used.
Well, you could optimize it. But firstly is it really too slow? Try drawing the shadow into a separate pixmap in the beginning and then just render it in the paintEvent(instead of generating it every time).
If that's still too slow for you, there are multiple ways of optimizing the function.
Thank you mate, this is very good example,
I gonna use it.![]()
Bookmarks