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


C# Image.EndInit方法代码示例

本文整理汇总了C#中System.Windows.Controls.Image.EndInit方法的典型用法代码示例。如果您正苦于以下问题:C# Image.EndInit方法的具体用法?C# Image.EndInit怎么用?C# Image.EndInit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Controls.Image的用法示例。


在下文中一共展示了Image.EndInit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DrawOneFinalPage

		TabItem DrawOneFinalPage (GraphicsHandling GraphicsHandlingInstance, String PageID)
			{
			double TargetAspectRatio = GraphicsHandlingInstance.TargetPictureWidth / GraphicsHandlingInstance.TargetPictureHeight;
			double ResizingFactor = GraphicsHandlingInstance.TargetPictureWidth / DrawingWidth;
			Thickness BorderThickness = new Thickness ();
			BorderThickness.Left = 3;
			BorderThickness.Right = 3;
			BorderThickness.Top = 3;
			BorderThickness.Bottom = 3;
			BrushConverter BRConverter = new BrushConverter ();
			TabItem NewItem = new TabItem ();
			NewItem.ContextMenuOpening += new ContextMenuEventHandler (NewItem_ContextMenuOpening);
			NewItem.Tag = PageID;
			PicturesTabControl.Items.Add (NewItem);
			PicturesTabControl.SelectedItem = NewItem;
			int PageIndex = GraphicsHandlingInstance.PageIDsToPlay.FindIndex (delegate (String Entry)
			    { return (PageID == Entry); } );
			Grid TabItemGrid = m_XAML.CreateGrid (new int [] { 1 }, new int [] { 20, 1 });
			String PlayTime = " (" + GraphicsHandlingInstance.GetPageDuration (PageID).ToString () + ")";
			String PageName = "Seite " + Convert.ToString (PageIndex + 1) + PlayTime;
			NewItem.Content = TabItemGrid;

			NewItem.Header = PageName;

			Image JustifiedImage = new Image ();
			JustifiedImage.ContextMenuOpening += new ContextMenuEventHandler (JustifiedImage_ContextMenuOpening);
			RedrawInformation RedrawData = new RedrawInformation (PageID, ++PageIndex, JustifiedImage);
			JustifiedImage.Tag = RedrawData;
			BitmapSource ImageSource = GraphicsHandlingInstance.GetCreatedFrameBitmapSource (RedrawData);
			if (!String.IsNullOrEmpty (m_WebLinkData))
				{
				m_WebSizing.Width /= (float) ResizingFactor;
				m_WebSizing.Height /= (float) ResizingFactor;
				return NewItem;
				}
			JustifiedImage.BeginInit ();
			JustifiedImage.Source = ImageSource;
			JustifiedImage.Width = GraphicsHandlingInstance.TargetPictureWidth / ResizingFactor;
			JustifiedImage.EndInit ();
			Border ImageBorder = new Border ();
			TabItemGrid.Children.Add (ImageBorder);
			ImageBorder.BorderThickness = BorderThickness;
			ImageBorder.BorderBrush = (Brush) BRConverter.ConvertFromString ("Black");
			ImageBorder.Child = JustifiedImage;
			ImageBorder.Width = (GraphicsHandlingInstance.TargetPictureWidth / ResizingFactor) + BorderThickness.Left + BorderThickness.Right;
			ImageBorder.Height = (GraphicsHandlingInstance.TargetPictureHeight / ResizingFactor) + BorderThickness.Top + BorderThickness.Bottom;
			Grid.SetColumn (ImageBorder, 0);
			Grid.SetRow (ImageBorder, 0);

			Grid DescriptionTextGrid = m_XAML.CreateGrid (new int [] { 70, 30 }, new int [] { 10 });
			TabItemGrid.Children.Add (DescriptionTextGrid);
			Grid.SetColumn (DescriptionTextGrid, 0);
			Grid.SetRow (DescriptionTextGrid, 1);
			TextBox BasePictureText = new TextBox ();
			DescriptionTextGrid.Children.Add (BasePictureText);
			Grid.SetColumn (BasePictureText, 1);
			Grid.SetRow (BasePictureText, 0);
			BasePictureText.Text = "(" + Convert.ToString ((int) GraphicsHandlingInstance.TargetPictureWidth) + " * "
				+ Convert.ToString ((int) GraphicsHandlingInstance.TargetPictureHeight) + " - "
				+ String.Format ("{0:0.000}", GraphicsHandlingInstance.TargetPictureWidth 
				/ GraphicsHandlingInstance.TargetPictureHeight) + ") " + PageName;
			BasePictureText.TextAlignment = TextAlignment.Right;
			return NewItem;
			}
开发者ID:heinzsack,项目名称:DEV,代码行数:64,代码来源:TableProcessing.xaml.cs


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