views:

110

answers:

0

I'm trying to figure out how to stop LinearGradientBrush to repeat along with shape I'm drawing. So, for example I created gradient with height equal to 50, but next I draw rectangle with height equal to 150. In that case gradient will repeat itself three times. But I'd like to draw only first gradient and draw nothing for the rest of rectangle. Seems GradientBrush in WPF supports SpreadMethod(http://msdn.microsoft.com/en-us/library/system.windows.media.gradientbrush.spreadmethod.aspx) for this purpose, but does something exists for WinForms as well?