Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will using gradients impact WP7 performance?

A coworker of mine suggested I avoid using any gradients in my mobile apps because the phones can't handle the work load required for rendering gradients on buttons/backgrounds etc. I have not seen any hang ups or anything when rendering buttons, but are there gradients I should avoid?

like image 729
firebellys Avatar asked Nov 17 '25 06:11

firebellys


2 Answers

It depends on where you use it. If you are comparing a SolidColorBrush against a GradientBrush ofcourse there is more work to do by the platform to render the gradient, but it is a negligible performance difference.

The only case I can think of is, suppose you use a complex gradient in a large ListBox and used it inside ListBoxItems, which makes a lot of that gradients get instantiated. In that case I would rather replace gradient with a low quality JPEG. The JPEG(Image) will give me more system level caching automatically and the listbox will performs better than you providing vector-gradient in there.

But if it is individual buttons or some other control styling it is totally fine to use Gradients.

More of this kind of tips can be found in my blog here - http://jobijoy.blogspot.com/2011/05/wp7dev-tip-2-few-things-to-remember-on.html

like image 100
Jobi Joy Avatar answered Nov 18 '25 20:11

Jobi Joy


I don't see why gradients would affect performance, but gradients don't render well on many WP7 screens, since they are optimised for metro, which doesn't promote gradients. I've seen colour banding on an HTC Trophy we used for a prototype

like image 34
Richard Szalay Avatar answered Nov 18 '25 19:11

Richard Szalay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!