本文整理汇总了C#中Image.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Image.GetValue方法的具体用法?C# Image.GetValue怎么用?C# Image.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Image
的用法示例。
在下文中一共展示了Image.GetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSource
public static string GetSource(Image image)
{
if (image == null)
{
throw new ArgumentNullException("Image");
}
return (string)image.GetValue(ImageDecoder.SourceProperty);
}
示例2: GetUriSource
public static Uri GetUriSource(Image obj)
{
if (null == obj)
{
throw new ArgumentNullException("obj");
}
return (Uri)obj.GetValue(UriSourceProperty);
}
示例3: GetSource
public static string GetSource(Image img)
{
if (img == null)
{
return null;
}
return (string)img.GetValue(SourceProperty);
}
示例4: GetImageBounds
private Rect GetImageBounds(Image img)
{
double x = (double)img.GetValue(Canvas.LeftProperty);
double y = (double)img.GetValue(Canvas.TopProperty);
double width = (double)img.GetValue(Canvas.WidthProperty);
double height = (double)img.GetValue(Canvas.HeightProperty);
if (double.IsNaN(width) && img.Source != null)
{
width = img.Source.Width;
height = img.Source.Height;
}
return new Rect(x, y, width, height);
}
示例5: GetSourceUri
public static Uri GetSourceUri(Image image)
{
return (Uri)image.GetValue(SourceUriProperty);
}
示例6: InitImages
void InitImages()
{
#region Board
Image img = new Image();
img.Source = new BitmapImage(new Uri("/Images/Parts/Board.png", UriKind.RelativeOrAbsolute));
img.Name = "boardPart";
img.Width = (browserWidth * 3 / 4);
img.Height = (browserHeight * 0.70);
img.Stretch = Stretch.Fill;
double imageCanvasLeft = (browserWidth - img.Width) / 2;
double imageCanvasTop = (browserHeight - img.Height) / 6;
img.SetValue(Canvas.LeftProperty, imageCanvasLeft);
img.SetValue(Canvas.TopProperty, imageCanvasTop);
this.LayoutRoot.Children.Add(img);
board = img;
#endregion
#region Animals
// Tiger
Image tiger = new Image();
tiger.Source = new BitmapImage(new Uri("/Images/Parts/Tiger.png", UriKind.RelativeOrAbsolute));
tiger.Width = browserWidth / 11;
double tigerCanvasLeft = imageCanvasLeft + img.Width / 1.5;
double tigerCanvasTop = (double)img.GetValue(Canvas.TopProperty) + img.Height / 1.17;
tiger.SetValue(Canvas.LeftProperty, tigerCanvasLeft);
tiger.SetValue(Canvas.TopProperty, tigerCanvasTop);
this.LayoutRoot.Children.Add(tiger);
// Pig
Image pig = new Image();
pig.Source = new BitmapImage(new Uri("/Images/Parts/Pig.png", UriKind.RelativeOrAbsolute));
pig.Width = tiger.Width / 1.5;
double pigCanvasLeft = (double)tiger.GetValue(Canvas.LeftProperty) - tiger.Width / 2;
double pigCanvasTop = (double)tiger.GetValue(Canvas.TopProperty) * 1.08;
pig.SetValue(Canvas.LeftProperty, pigCanvasLeft);
pig.SetValue(Canvas.TopProperty, pigCanvasTop);
this.LayoutRoot.Children.Add(pig);
#endregion
#region Posts
// Homepage
Image postHome = new Image();
postHome.Source = new BitmapImage(new Uri("/Images/Parts/BackToHomePage.png", UriKind.RelativeOrAbsolute));
postHome.Width = imageCanvasLeft * 0.8;
double postHomeCanvasLeft = (imageCanvasLeft - postHome.Width) / 2;
double postHomeCanvasTop = imageCanvasTop * 3.9;
postHome.SetValue(Canvas.LeftProperty, postHomeCanvasLeft);
postHome.SetValue(Canvas.TopProperty, postHomeCanvasTop);
postHome.Name = "imgPostHome";
postHome.MouseEnter += new MouseEventHandler(postHome_MouseEnter);
postHome.MouseLeave += new MouseEventHandler(postHome_MouseLeave);
postHome.MouseLeftButtonUp += new MouseButtonEventHandler(postHome_MouseLeftButtonUp);
//postHome.SetValue(ToolTipService.ToolTipProperty, ITBusSilverlightCommons.GetToolTip("Về trang chủ"));
this.LayoutRoot.Children.Add(postHome);
// Lessions
Image postLessions = new Image();
postLessions.Source = new BitmapImage(new Uri("/Images/Parts/LessionsBoard.png", UriKind.Relative));
postLessions.Width = postHome.Width * 0.9;
double postLessionsCanvasLeft = (img.Width + imageCanvasLeft) + postLessions.Width / 5;
double postLessionsCanvasTop = imageCanvasTop * 10;
postLessions.SetValue(Canvas.LeftProperty, postLessionsCanvasLeft);
postLessions.SetValue(Canvas.TopProperty, postLessionsCanvasTop);
postLessions.Name = "imgPostLessions";
this.StoryboardFading.SetValue(Storyboard.TargetNameProperty, postLessions.Name);
postLessions.MouseEnter += new MouseEventHandler(postLessions_MouseEnter);
postLessions.MouseLeave += new MouseEventHandler(postLessions_MouseLeave);
postLessions.MouseLeftButtonUp += new MouseButtonEventHandler(postLessions_MouseLeftButtonUp);
//postLessions.SetValue(ToolTipService.ToolTipProperty, ITBusSilverlightCommons.GetToolTip("Danh sách bài học"));
this.LayoutRoot.Children.Add(postLessions);
#endregion
#region Buttons
this.btnBack1.Width = postHome.Width / 1.5;
//.........这里部分代码省略.........
示例7: GetSourceWithCustomReferer
public static Uri GetSourceWithCustomReferer(Image image)
{
if (image == null)
{
throw new ArgumentNullException("Image");
}
return (Uri)image.GetValue(SourceWithCustomRefererProperty);
}
示例8: GetIsLoading
public static bool GetIsLoading(Image obj)
{
return (bool)obj.GetValue(IsLoadingProperty);
}
示例9: GetDisplayWaitingAnimationDuringLoading
public static bool GetDisplayWaitingAnimationDuringLoading(Image obj)
{
return (bool)obj.GetValue(DisplayWaitingAnimationDuringLoadingProperty);
}
示例10: GetErrorDetected
public static bool GetErrorDetected(Image obj)
{
return (bool)obj.GetValue(ErrorDetectedProperty);
}
示例11: GetDisplayOption
public static DisplayOptions GetDisplayOption(Image obj)
{
return (DisplayOptions)obj.GetValue(DisplayOptionProperty);
}
示例12: GetDisplayErrorThumbnailOnError
public static bool GetDisplayErrorThumbnailOnError(Image obj)
{
return (bool)obj.GetValue(DisplayErrorThumbnailOnErrorProperty);
}
示例13: SetImagePosition
private void SetImagePosition(Image image, Joint joint)
{
var scaledJoint = joint.ScaleTo(640, 480, k_xMaxJointScale, k_yMaxJointScale);
Canvas.SetLeft(image, scaledJoint.Position.X - (double)image.GetValue(Canvas.WidthProperty) / 2);
Canvas.SetTop(image, scaledJoint.Position.Y - (double)image.GetValue(Canvas.WidthProperty) / 2);
Canvas.SetZIndex(image, (int)-Math.Floor(scaledJoint.Position.Z * 100));
}
示例14: GetIsSmartVisibilityEnabled
public static bool GetIsSmartVisibilityEnabled(Image element)
{
return (bool)element.GetValue(IsSmartVisibilityEnabledProperty);
}
示例15: GetSource
public static string GetSource(Image obj)
{
return (string)obj.GetValue(SourceProperty);
}