本文整理汇总了C#中System.Arguments.AddImages方法的典型用法代码示例。如果您正苦于以下问题:C# Arguments.AddImages方法的具体用法?C# Arguments.AddImages怎么用?C# Arguments.AddImages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Arguments
的用法示例。
在下文中一共展示了Arguments.AddImages方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ImageCarouselCanvas
public ImageCarouselCanvas(Arguments args)
{
this.CloseOnClick = true;
this.Container = new Canvas
{
Width = DefaultWidth,
Height = DefaultHeight
};
//var r = new Rectangle
//{
// Fill = Brushes.Red,
// Opacity = 0.05
//};
//r.SizeTo(DefaultWidth, DefaultHeight);
//r.AttachTo(this);
//this.Container.Background = Brushes.Transparent;
//this.Container.Background = Brushes.Red;
var y = 0;
var s = new Stopwatch();
s.Start();
var images = new List<XImage>();
#region AddImages
Func<Image, XImage> Add =
i =>
{
y += 32;
var n = new XImage
{
Image = i,
Opacity = 0,
Radius = 72
};
RenderOptions.SetBitmapScalingMode(i, BitmapScalingMode.Fant);
images.Add(n);
i.Opacity = 0;
i.AttachTo(this);
return n;
};
args.AddImages(Add);
#endregion
var size = 64;
Action<DispatcherTimer> AtAnimation = delegate { };
// .net is fast, but js will be slow :)
var randomphase = Math.PI * 2 * new Random().NextDouble();
#region AtIntervalWithTimer
var AnimationTimer = (1000 / 50).AtIntervalWithTimer(
t =>
{
var ms = s.ElapsedMilliseconds;
var i = 0;
AtAnimation(t);
// using for each must be the last thing in a method
// because .leave operator currently cannot be understood by jsc
foreach (var item_ in images)
{
var item = item_.Image;
var phase = Math.PI * 2 * i / images.Count + randomphase;
var cos = Math.Cos(step * ms + phase);
var sin = Math.Sin(step * ms + phase);
var z1margin = 0.7;
var z1 = (cos + (1 + z1margin)) / (2 + z1margin);
var z2margin = 1.0;
var z2 = (cos + (1 + z2margin)) / (2 + z2margin);
item.Opacity = z1 * item_.Opacity;
item.SizeTo(size * z2, size * z2);
item.MoveTo(
//.........这里部分代码省略.........