我有一个noob问题= P. 如何以编程方式将画布添加到网格?当我使用
Canvas _canvas = new Canvas( )
{
Name = "newCanvas",
Visibility = System.Windows.Visibility.Visible,
Margin = new Thickness( 100, 0, 0, 100 ),
Width = 100000,
Height = 100000,
Background = new SolidColorBrush { Color = new Color { R = 255, G = 255, B = 255, A = 1 } }
};
然后说LayoutRoot.Children.Add( _canvas );
答案 0 :(得分:5)
Alpha
参数也是0 - 255,而不是0.0 - 1.0