本文整理汇总了C#中System.Windows.Shapes.Rectangle.ToAnimatedOpacity方法的典型用法代码示例。如果您正苦于以下问题:C# Rectangle.ToAnimatedOpacity方法的具体用法?C# Rectangle.ToAnimatedOpacity怎么用?C# Rectangle.ToAnimatedOpacity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Shapes.Rectangle
的用法示例。
在下文中一共展示了Rectangle.ToAnimatedOpacity方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplicationCanvas
//.........这里部分代码省略.........
var trig = new Avalon.Images._17g()
{
Width = 100,
Height = 100,
}.AttachTo(this);
var tri2 = new Avalon.Images._17()
{
Width = 100,
Height = 100,
}.AttachTo(this);
var trig2 = new Avalon.Images._17g()
{
Width = 100,
Height = 100,
}.AttachTo(this);
// cursor position calculations are not ready
// for transofrmed elements.
// we will provide a floor for those events...
var shadow = new Rectangle
{
Width = DefaultWidth,
Height = DefaultHeight,
Fill = Brushes.Black,
}.AttachTo(this);
var shadowa = shadow.ToAnimatedOpacity();
shadowa.Opacity = 0;
Func<Brush, int, int, Movable> m =
(Color, X, Y) =>
{
var m0 = new Movable
{
Context = this,
Color = Color
};
m0.MoveTo(X, Y);
return m0;
};
var m1 = m(Brushes.Green, 250, 50);
var m2 = m(Brushes.Red, 250 + 100, 50);
var m3 = m(Brushes.Blue, 250, 50 + 100);
var m4 = m(Brushes.Yellow, 250 + 100, 50 + 100);
var m5 = m(Brushes.Green, 250 + 200, 50);
var m6 = m(Brushes.Blue, 250 + 200, 50 + 100);
Movables = new[] { m1, m2, m3, m4, m5, m6};
Action Update =
delegate
{
示例2: AvalonBetrisCanvas
//.........这里部分代码省略.........
var trig = new Image
{
Width = aw,
Height = ah,
Source = "assets/AvalonBetris/_19b.png".ToSource()
}.AttachTo(this);
var tri2 = new Image
{
Width = aw,
Height = ah,
Source = "assets/AvalonBetris/_18a.png".ToSource()
}.AttachTo(this);
var trig2 = new Image
{
Width = aw,
Height = ah,
Source = "assets/AvalonBetris/_18b.png".ToSource()
}.AttachTo(this);
// cursor position calculations are not ready
// for transofrmed elements.
// we will provide a floor for those events...
var shadow = new Rectangle
{
Width = DefaultWidth,
Height = DefaultHeight,
Fill = Brushes.Black,
}.AttachTo(this);
var shadowa = shadow.ToAnimatedOpacity();
shadowa.Opacity = 0;
Func<Brush, int, int, Movable> m =
(Color, X, Y) =>
{
var m0 = new Movable
{
Context = this,
Color = Color
};
m0.MoveTo(X, Y);
return m0;
};
var m1 = m(Brushes.Green, 197, 123);
var m2 = m(Brushes.Red, 224, 110);
var m3 = m(Brushes.Blue, 197, 161);
var m4 = m(Brushes.Yellow, 222, 159);
var m5 = m(Brushes.Green, 265, 118);
var m6 = m(Brushes.Blue, 265, 166);
Action Update =
delegate
{
tri.RenderTransform = new AffineTransform
{
Left = 0,
示例3: InteractiveSketchupWarehouseCanvas
public InteractiveSketchupWarehouseCanvas()
{
Width = DefaultWidth;
Height = DefaultHeight;
Background = Brushes.White;
this.ClipToBounds = true;
//Colors.Cyan.ToGradient(Colors.White, DefaultHeight / 4).Select(
// (c, i) =>
// new Rectangle
// {
// Fill = new SolidColorBrush(c),
// Width = DefaultWidth,
// Height = 4,
// }.MoveTo(0, i * 4).AttachTo(this)
//).ToArray();
var img = new Image
{
Width = 400,
Height = 300
};
img.AttachTo(this);
new TextBox
{
Foreground = Brushes.Red,
Width = DefaultWidth,
BorderThickness = new Thickness(0),
Background = Brushes.Transparent,
IsReadOnly = true,
Height = 32,
Text = "Flash version will only work in web context!"
}.AttachTo(this);
var imagenum = 34;
var src_uri = ApplyFrame(imagenum);
img.Cursor = Cursors.Hand;
var xoverlay = new Rectangle
{
Width = DefaultWidth,
Height = DefaultHeight,
Fill = Brushes.Black,
Opacity = 0,
Cursor = Cursors.Hand,
}.AttachTo(this);
var bg = new Rectangle
{
Width = DefaultWidth,
Height = DefaultHeight,
Fill = Brushes.Black,
}.AttachTo(this);
var bga = bg.ToAnimatedOpacity();
bg.Opacity = 0.5;
var c = new ScriptCoreLib.Shared.Avalon.Carousel.SimpleCarouselControl(DefaultWidth, DefaultHeight);
var options = new[]
{
"58eca9d1551fde5a3b70edf326d07e86",
"6e006174683f7372de48c10a5a3895c4",
"5ff285283e8ec610434fdb742d7e0cea",
"8d4d82e8807c3823bd4169514fca71f2",
"bad472a435d3fab41992a70eb6b3a2a6",
"3a4a2c47e8d8fdbb7302a5e36ce363de",
"982a7381b7c5f4d36dce312d2cfb61e8",
"84bafa682ff9c15b665aa76cf50df2c3",
"9533d2d07d433ac072f17dbd3c237580",
"d7222464c02cca18e92340be97470aea",
"67a2216e4253e3f75eb112e8bc6bbc53",
"5f310d576a8180e2ae504fdbdb5a7e96",
"d106aaeaa51217cc465e08d496c0420f",
"d2f505aca92ee65fbdb8512730b99253"
};
var position = 0.0;
var a = c.Container.ToAnimatedOpacity();
a.Opacity = 1;
foreach (var mid_ in options.Randomize())
{
var mid = mid_;
position += 0.6;
//.........这里部分代码省略.........
示例4: OrcasAvalonApplicationCanvas
public OrcasAvalonApplicationCanvas()
{
Width = DefaultWidth;
Height = DefaultHeight;
this.ClipToBounds = true;
var x = GameReferenceExtensions.Default;
var Content = new Canvas
{
Width = DefaultWidth,
Height = DefaultHeight,
}.AttachTo(this);
int LogoSize = 32;
new Image
{
Width = LogoSize,
Height = LogoSize,
Source = ("assets/Bulldog.Promotion/jsc.png").ToSource()
}.MoveTo(DefaultWidth - LogoSize, DefaultHeight - LogoSize).AttachTo(this);
var TouchOverlayContainer = new Canvas
{
Width = DefaultWidth,
Height = DefaultHeight,
}.AttachTo(this);
var wc = new WebClient();
var List = new List<Entry>();
#region load
wc.DownloadStringCompleted +=
(sender, args) =>
{
var a = GameReferenceExtensions.Partial;
a.ForEach(k => k.Source = k.Image.Substring(GameReferenceExtensions.Host.Length + 1));
if (args.Error == null)
a = a.FromYAML(args.Result);
this.Dispatcher.Invoke(
(Action)
delegate
{
var i = 0;
foreach (var k_ in a)
{
var k = k_;
var Container = new Canvas
{
Width = GameReferenceExtensions.Width,
Height = GameReferenceExtensions.Height,
}.AttachTo(Content).MoveTo(0, i * GameReferenceExtensions.Height);
var Image = new Image
{
Width = GameReferenceExtensions.Width,
Height = GameReferenceExtensions.Height,
Stretch = Stretch.Fill
}.AttachTo(Container);
var Shadow = new Rectangle
{
Fill = Brushes.Black,
Opacity = 0.5,
Width = GameReferenceExtensions.Width - 2 * 2,
Height = GameReferenceExtensions.Height / 3,
}.AttachTo(Container).MoveTo(2, GameReferenceExtensions.Height / 3);
var ShadowBottom = new Rectangle
{
Fill = Brushes.Black,
Width = GameReferenceExtensions.Width - 2 * 2,
Height = GameReferenceExtensions.Height / 3 / 2,
}.AttachTo(Container).MoveTo(2, GameReferenceExtensions.Height / 3 + GameReferenceExtensions.Height / 3 / 2);
var AnimatedShadow = Shadow.ToAnimatedOpacity();
AnimatedShadow.Opacity = 0;
var AnimatedShadowBottom = ShadowBottom.ToAnimatedOpacity();
AnimatedShadowBottom.Opacity = 0;
var Text = new TextBox
{
BorderThickness = new Thickness(0),
Width = GameReferenceExtensions.Width * 2,
Background = Brushes.Transparent,
Foreground = Brushes.White,
IsReadOnly = true,
Text = k.Title,
TextAlignment = TextAlignment.Center,
//.........这里部分代码省略.........
示例5: ApplicationCanvas
public ApplicationCanvas()
{
var Container720X = new Canvas().AttachTo(this);
Container720 = new Canvas().AttachTo(Container720X);
//Container720A = Container720.ToAnimatedOpacity();
i = new Avalon.Images.Promotion3D_controller_720p();
i.AttachTo(Container720);
iA = i.ToAnimatedOpacity();
iA.Opacity = 0.8;
var ShadowOverlay = new Rectangle { Fill = Brushes.Black };
var ShadowOverlayA = ShadowOverlay.ToAnimatedOpacity();
ShadowOverlay.AttachTo(Container720);
ShadowOverlay.SizeTo(1280, 720);
ii = new Avalon.Images.Promotion3D_controller_android_720();
ii.AttachTo(Container720);
var iiA = ii.ToAnimatedOpacity();
var Title = new Avalon.Images.Title();
Title.AttachTo(Container720X);
this.SizeChanged += (s, e) =>
{
Container720X.MoveTo(
(this.Width - 1280) / 2,
(this.Height - 720) / 2
);
Console.WriteLine(new { this.Width, this.Height });
};
enter = new Avalon.Images.start
{
Cursor = Cursors.Hand
}.AttachTo(this);
entero = enter.ToAnimatedOpacity();
this.SizeChanged += (s, e) => enter.MoveTo(
(this.Width - 128) * 0.8 + 64,
(this.Height - 128) / 2 + 32);
#region Black
{
Rectangle r = new Rectangle();
r.Fill = Brushes.Black;
r.AttachTo(this);
r.MoveTo(0, 0);
this.SizeChanged += (s, e) =>
{
r.Width = this.Width;
r.Height = ((this.Height - 720) / 2).Max(0);
};
}
{
Rectangle r = new Rectangle();
r.Fill = Brushes.Black;
r.AttachTo(this);
r.MoveTo(0, 0);
this.SizeChanged += (s, e) =>
{
r.Width = this.Width;
// NotImplementedException
//at ScriptCoreLib.ActionScript.BCLImplementation.System.Windows::__UIElement/InternalGetHeight_100663344()
//at ScriptCoreLib.ActionScript.BCLImplementation.System.Windows::__UIElement/VirtualGetHeight_100663342()
//at ScriptCoreLib.ActionScript.BCLImplementation.System.Windows::__FrameworkElement/get Height()
var Height = ((this.Height - 720) / 2).Max(0);
r.Height = Height;
r.MoveTo(0, this.Height - Height);
};
}
#endregion
var hotzone = new Rectangle { Fill = Brushes.Green, Opacity = 0 }.AttachTo(Container720X);
hotzone.Cursor = Cursors.Hand;
hotzone.MoveTo(1280 / 3, 720 * 2 / 3);
hotzone.SizeTo(1280 / 3, 720 / 3);
//.........这里部分代码省略.........
示例6: ApplicationCanvas
//.........这里部分代码省略.........
}
);
Enumerable.FirstOrDefault(
from k in Windows
let dx0 = Math.Abs(k.WindowLocation.Top - y)
where dx0 < Snap
orderby dx0
select k
).With(
ax =>
{
SnapMode = true;
cy += y - ax.WindowLocation.Top;
y = ax.WindowLocation.Top;
}
);
SetLocation(SnapMode, x, y, cx, cy);
};
#endregion
#region MouseLeftButtonDown
r.MouseLeftButtonDown +=
(s, e) =>
{
h = new Rectangle
{
Fill = Brushes.Black,
};
hOpacity = h.ToAnimatedOpacity();
hOpacity.Opacity = 0.3;
var p = e.GetPosition(r);
//Console.WriteLine("MouseLeftButtonDown " + new { p.X, p.Y });
GetPosition = y => y(p.X, p.Y);
h.AttachTo(c).MoveTo(p).SizeTo(0, 0);
c.Selection.Orphanize();
c.Selection.WindowLocation.Left = p.X;
c.Selection.WindowLocation.Top = p.Y;
c.Selection.WindowLocation.Width = 0;
c.Selection.WindowLocation.Height = 0;
c.Selection.WindowLocationChanged();
c.Selection.Attach();
Windows.WithEach(k => k.GlassOpacity.Opacity = 0);
};
#endregion
#region MouseMove
r.MouseMove +=
(s, e) =>
{
if (GetPosition != null)
示例7: InitializeContent
void InitializeContent()
{
Colors.Blue.ToGradient(Colors.Red, Convert.ToInt32( Height) / 4).Select(
(c, i) =>
new Rectangle
{
Fill = new SolidColorBrush(c),
Width = Width,
Height = 4,
}.MoveTo(0, i * 4).AttachTo(this)
).ToArray();
//var help = new Image
//{
// Source = (KnownAssets.Path.Assets + "/help.png").ToSource()
//}.AttachTo(this);
//help.Opacity = 0;
var img = new Image
{
Source = new Avalon.Images.jsc().Source
}.MoveTo(Width - 128, Height - 128).AttachTo(this);
var t = new TextBox
{
FontSize = 10,
Text = "powered by jsc",
BorderThickness = new Thickness(0),
Foreground = 0xffffffff.ToSolidColorBrush(),
Background = Brushes.Transparent,
IsReadOnly = true,
Width = Width
}.MoveTo(8, 8).AttachTo(this);
//help.Opacity = 1;
img.Opacity = 0.5;
// cursor position calculations are not ready
// for transofrmed elements.
// we will provide a floor for those events...
var shadow = new Rectangle
{
Width = Width,
Height = Height,
Fill = Brushes.Black,
}.AttachTo(this);
var shadowa = shadow.ToAnimatedOpacity();
shadowa.Opacity = 0;
var a = new AffineMesh();
Func<double, double, double, Brush, AffinePoint> a_Add =
(X, Y, Z, Fill) =>
{
var p = new AffinePoint { Z = Z, X = X, Y = Y };
var h = new Rectangle { Fill = Fill, Width = 4, Height = 4 }.AttachTo(this);
//var ht = new TextBox { }.AttachTo(this);
var historysize = 64;
var history = new Queue<Rectangle>();
Action<AffinePoint> p_Update =
pp =>
{
if (history.Count > historysize)
{
history.Dequeue();
}
// -100 == 0.5
// 0 == 1
// +100 == 2
//var zoom = (pp.Z) / 1000;
var zoom = 0.5;
var pp_X = Width / 2 - 4 + pp.X * zoom;
var pp_Y = Height / 2 - 4 + pp.Y * zoom;
// Z is ignored here
// but could be used for sorting
h.MoveTo(pp_X, pp_Y);
//.........这里部分代码省略.........