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