I trying to port System.Drawing: public LinearGradientBrush( Rectangle rect, Color color1, Color color2, float angle ) to System.Windows.Media . I can get the angle to be correct but I can't get the start and end to be at the corners. I have tried scaling the brush's transform but that ends up messing the angle.
System.Drawing.Drawing2D.LinearGradientBrush: http://msdn.microsoft.com/en-us/library/ms142563.aspx
System.Windows.Media.LinearGradientBrush: http://msdn.microsoft.com/en-us/library/ms602517.aspx