当前位置: 首页>>代码示例>>C#>>正文


C# Canvas.ClipTo方法代码示例

本文整理汇总了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
//.........这里部分代码省略.........
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:101,代码来源:AvalonExampleGalleryCanvas.cs


注:本文中的System.Windows.Controls.Canvas.ClipTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。