本文整理汇总了C#中System.Windows.Controls.Canvas.ClipTo方法的典型用法代码示例。如果您正苦于以下问题:C# Canvas.ClipTo方法的具体用法?C# Canvas.ClipTo怎么用?C# Canvas.ClipTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.Canvas
的用法示例。
在下文中一共展示了Canvas.ClipTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AvalonExampleGalleryCanvas
public AvalonExampleGalleryCanvas(bool EnableBackground, Func<string, OptionPosition> GetOptionPosition)
{
Width = DefaultWidth;
Height = DefaultHeight;
var navbar = new AeroNavigationBar();
var Container = new Canvas
{
Width = DefaultWidth,
Height = DefaultHeight,
Name = "AvalonExampleGalleryCanvas_Container"
}.AttachTo(this);
Container.ClipTo(0, 0, DefaultWidth, DefaultHeight);
var Pages = new Canvas
{
Width = DefaultWidth,
Height = DefaultHeight,
Name = "AvalonExampleGalleryCanvas_Pages"
}.AttachTo(this);
var CarouselPages = new Canvas
{
Width = DefaultWidth,
Height = DefaultHeight,
Name = "AvalonExampleGalleryCanvas_CarouselPages"
}.AttachTo(this);
var Overlay = new Canvas
{
Width = DefaultWidth,
Height = DefaultHeight,
Name = "AvalonExampleGalleryCanvas_Overlay"
}.AttachTo(this);
if (EnableBackground)
{
#region background
var bg = new TiledBackgroundImage(
"assets/AvalonExampleGallery/bg.png".ToSource(),
96,
96,
9,
8
).AttachContainerTo(Container);
#endregion
}
var Toolbar = new Canvas
{
Width = DefaultWidth,
Height = navbar.Height,
Opacity = 0,
Name = "Toolbar"
}.AttachTo(this);
1000.AtDelay(
Toolbar.FadeIn
);
#region shadow
Colors.Black.ToTransparentGradient(40).Select(
(c, i) =>
{
return new Rectangle
{
Fill = new SolidColorBrush(c),
Width = DefaultWidth,
Height = 1,
Opacity = c.A / 255.0
}.MoveTo(0, i).AttachTo(Toolbar);
}
).ToArray();
#endregion
var cc = new SimpleCarouselControl(DefaultWidth, DefaultHeight);
const string cc_Caption = "Click on a thumbnail!";
cc.Caption.Text = cc_Caption;
cc.Timer.Stop();
var btnCarouselCanvas = new Canvas
{
Width = 128,
Height = 32,
}.AttachTo(this).MoveTo(DefaultWidth - 128, 4);
#region Options
//.........这里部分代码省略.........