本文整理汇总了C#中System.Windows.Media.RotateTransform.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# RotateTransform.Clone方法的具体用法?C# RotateTransform.Clone怎么用?C# RotateTransform.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.RotateTransform
的用法示例。
在下文中一共展示了RotateTransform.Clone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: fillCircles
void fillCircles()
{
Point centre = new Point(100, 100);
RotateTransform rt = new RotateTransform(360.0 / numberCircles);
rt.CenterX = 45;
rt.CenterY = 45;
TranslateTransform yoffset = new TranslateTransform(20, 20);
TranslateTransform goffset = new TranslateTransform(21, 20);
TranslateTransform roffset = new TranslateTransform(19, 20);
RotateTransform rt2;
yellows = new List<Ellipse>();
reds = new List<Ellipse>();
greens = new List<Ellipse>();
// do in order of visibility
for (int i = 0; i < numberCircles; i++)
{
// a red
Ellipse rc = new Ellipse();
rc.Stroke = new SolidColorBrush(Color.FromArgb(127, 255, 0, 0));
rc.Height = 50;
rc.Width = 50;
rt2 = rt.Clone();
rt2.Angle = (rt2.Angle * i) + (rt2.Angle / 3);
TransformGroup rtg = new TransformGroup();
rtg.Children.Add(rt2);
rtg.Children.Add(roffset);
rc.RenderTransform = rtg;
// a green
Ellipse gc = new Ellipse();
gc.Stroke = new SolidColorBrush(Color.FromArgb(127, 0, 255, 0));
gc.Height = 50;
gc.Width = 50;
rt2 = rt.Clone();
rt2.Angle = (rt2.Angle * i) - (rt2.Angle / 3);
TransformGroup gtg = new TransformGroup();
gtg.Children.Add(rt2);
gtg.Children.Add(goffset);
gc.RenderTransform = gtg;
// yc.RenderTransformOrigin = centre;
canvas1.Children.Add(rc);
canvas1.Children.Add(gc);
//canvas1.Children[canvas1.Children.IndexOf(yc)].t
reds.Add(rc);
greens.Add(gc);
}
for (int i = 0; i < numberCircles; i++)
{
// add a yellow
Ellipse yc = new Ellipse();
yc.Stroke = Brushes.Yellow; // new SolidColorBrush(Color.FromRgb(0, 255, 255));
yc.Height = 50;
yc.Width = 50;
rt2 = rt.Clone();
rt2.Angle *= i;
TransformGroup ytg = new TransformGroup();
ytg.Children.Add(rt2);
ytg.Children.Add(yoffset);
yc.RenderTransform = ytg;
canvas1.Children.Add(yc);
yellows.Add(yc);
}
}