locked
RadialGradientBrush in WInRT.. RRS feed

  • Question

  • Hi,

    WinRT don't have the support for RadialGradientBrush . Is there any way to achieve the RadialGradientBrush Effect?


    Raj
    Monday, November 7, 2011 10:09 AM

Answers

  • Correct.  Windows.UI.Xaml.Media does not include a RaidalGradientBrush, only a LinearGradientBrush.  If you need one you could generate the radial gradient into an ImageBrush.

    --Rob

    • Marked as answer by Jie Bao Wednesday, December 7, 2011 9:36 AM
    Monday, November 14, 2011 6:00 AM
    Moderator

All replies

  • Are you using C# or C++?
    Jeff Sanders (MSFT)
    Monday, November 7, 2011 4:42 PM
    Moderator
  • Hi Jeff,

    I'm using C# in my application.

     


    Raj
    Tuesday, November 8, 2011 8:33 AM
  • Correct.  Windows.UI.Xaml.Media does not include a RaidalGradientBrush, only a LinearGradientBrush.  If you need one you could generate the radial gradient into an ImageBrush.

    --Rob

    • Marked as answer by Jie Bao Wednesday, December 7, 2011 9:36 AM
    Monday, November 14, 2011 6:00 AM
    Moderator
  • Thanks Rob.
    Raj
    Thursday, November 17, 2011 3:32 AM
  • Rob, is there an overview that outlines all these shortcomings in C# or lists which features are available in which languages?
    Thursday, November 17, 2011 4:34 AM
  • What do you mean?  This is the same for either C++ or C#.  They both use the same Windows.UI.Xaml.

    Which classes and methods are available are documented in the Windows Runtime reference or you look them up in the Object Browser in Visual Studio (I usually use the Object Browser).

    There are differences if you use different UI frameworks (C++ can also use DirectX, and JavaScript uses HTML and WinJS instead of Xaml and WinRT).

    --Rob

    Thursday, November 17, 2011 5:57 AM
    Moderator
  • I would really like to see RadialGradientBrush added.  LinearGradientBrush is in there already and radial gradients are another core piece of rendering that needs to be part of the framework, even if you don't typically use it in Metro design.  Even browsers are starting to support radial gradients in their CSS extensions.

    Here's a scenario I ran into today when converting from Silverlight to WinRT.  Say I'm making a company logo or other similar thing in Expression Design, and that logo has radial gradients.  I can export the logo's XAML and it has radial gradients embedded in it.  Then if I import it into a Metro app, suddenly I can't display it as it was designed.  And I'm forced to manually switch the gradient to solid colors or some other hacky option.

    Is there a specific reason this is being left out?  Again, even if it doesn't meet with Metro design principles and isn't used in most cases, I still think it is core to any rendering framework and the option of using it should be there.


    actiprosoftware.com - Professional WPF, Silverlight, and WinForms UI controls and components

    Thursday, March 8, 2012 2:17 PM
  • Another common scenario... what about things like pie charts?  People almost always apply a subtle radial gradient background on the slices.  RadialGradientBrush should really be there to support this and not make developers depend on hacky image tricks.

    actiprosoftware.com - Professional WPF, Silverlight, and WinForms UI controls and components

    Thursday, March 15, 2012 2:09 PM
  • I wrote a custom gauge control which uses RadialGradientBrush in WPF and has to use LinearGradientBrush in Metro. The WPF version looks fantastic. The Metro version sucks. Please bring back RadialGradientBrush!
    Thursday, March 15, 2012 2:19 PM
  • I agree WinRT really needs RadialGradientBrush, you can't seriously expect Silverlight apps to blow WinRT apps away and expect the devs to move over. Time to reverse engineer it me thinks.


    http://pauliom.wordpress.com

    Sunday, March 18, 2012 4:40 PM
  • I'm porting a WPF app to Metro and I'm kind of amazed (and sadfaced) at how much has been left out of the XAML support.  At BUILD I remember presenters claiming that just about everything would port over from untouched.  I guess if you just use button and textblock that's right.  I hope you guys are planning to include some of this stuff before release!
    Thursday, May 3, 2012 4:49 AM
  • With the DPI scaling issues, it's much better to have things in vector format, so you don't have to worry about providing multiple images -140 etc... Unfortunately, I have some Illustrator content that I have output as Silverlight 4 Xaml in expression design, but because of the lack of RadialGradientBrush it doesn't work! 

    I would totally agree that this sort of thing should be implemented, it's not something that can be implemented by third parties.

    ...Stefan

    Friday, May 18, 2012 1:39 AM
  • I used SharpDx in my Managed Metro app to create a RadialGradientBrush and output a radial gradient as a background

    http://advertboy.wordpress.com/2012/05/20/radial-gradients-mini-path-geometry-sprites-infinite-scrolling-inertial-canvas/

    Incase you want to see how I did it check out my sample code.. warning upfront that it relies on SharpDx (which should pass Store certification last I checked)

    Also you can use WriteableBitmapEx to generate a bitmap of pixels with the radial gradient ..


    Make the web a beautiful place

    Sunday, May 20, 2012 1:36 AM
  • WHAT?  No RadialGradientBrush? 

    That's crazy.

    Why?

    Thursday, August 30, 2012 3:06 PM
  • If you look at the Silverlight implementation it goes all naitive at that leap. For some reason, that leap isn't currently supported. I believe the official line was that it's a performance headache. I don't buy it because of all the much talked about Direct X access. Ho hum, perhaps it will change.

    http://pauliom.wordpress.com

    Thursday, August 30, 2012 4:29 PM
  • One more vote for the RadialGradientBrush here. Thanks!
    Friday, January 4, 2013 5:18 PM
  • Just gone to use RadialGradientBrush and its not there !!!!!!
    Tuesday, January 8, 2013 12:23 PM
  • Not having the RaidalGradientBrush makes for some pretty ugly spheres.   I hope it is added soon to WinRT.
    Sunday, January 13, 2013 3:05 AM
  • Yikes, can't believe there's no RadialGradientBrush.  It is crazy to propose ImageBrush, there's no way an image brush can do live animation of the GradientStop of a RadialGradientBrush, which is very handy for all sorts of slick visual effects.   I'm confused.  First you gave me a rich wonderful WPF, then you stripped it down for Silverlight, ok, I'm willing to compromise for the web reach of Silverlight, but now you give me WinRT with even less than silverlight?  What the heck is with this downward trajectory in UI functionality???   Are you trying to force everyone to dump XAML and move to standards based JScript + SVG ?  I guess I can do that, but jeeze man, 10 years of investment in C# & WPF and XAML and Silverlight down the tubes.  Time to crack open my old 1990's javascript svg books, boy that's exciting ... feels like I'm going back to the stone age here...  And I notice windows 8.1 also has no RadialGradientBrush, so I guess you also don't listen to this loud customer feedback, so wow, that's even better... 
    Thursday, October 10, 2013 2:00 AM
  • Sorry to bump this but will RadialGradientBrush finally be implemented for the Universal Windows Platform?  Frankly it's silly that app developers (whose apps can run on desktops!) can't use radial gradient brushes, but they are fully supported in all web browsers (even mobile browsers) and Win2D.  Missing features like this make it hard for designers to want to design for the WinRT platform.

    actiprosoftware.com - Professional WPF, WinRT, Silverlight, and WinForms UI controls and components

    Wednesday, May 6, 2015 2:09 PM