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


C# Image.GetValue方法代码示例

本文整理汇总了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);
 }
开发者ID:JiNanCVT,项目名称:Calligraphy,代码行数:8,代码来源:ImageDecoder.cs

示例2: GetUriSource

 public static Uri GetUriSource(Image obj)
 {
     if (null == obj)
     {
         throw new ArgumentNullException("obj");
     }
     return (Uri)obj.GetValue(UriSourceProperty);
 }
开发者ID:yablokoff,项目名称:fbtimes_wp7,代码行数:8,代码来源:LowProfileImageLoader.cs

示例3: GetSource

 public static string GetSource(Image img)
 {
     if (img == null)
     {
         return null;
     }
     return (string)img.GetValue(SourceProperty);
 }
开发者ID:kamaelyoung,项目名称:Ichongli.Rosi,代码行数:8,代码来源:ThinkImage.cs

示例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);
        }
开发者ID:ChrisJamesSadler,项目名称:Cosmos,代码行数:15,代码来源:AbsoluteScreen.xaml.cs

示例5: GetSourceUri

 public static Uri GetSourceUri(Image image)
 {
     return (Uri)image.GetValue(SourceUriProperty);
 }
开发者ID:tpola,项目名称:XamlAnimatedGif,代码行数:4,代码来源:AnimationBehavior.cs

示例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;

//.........这里部分代码省略.........
开发者ID:lengocluyen,项目名称:pescode,代码行数:101,代码来源:Parts.xaml.cs

示例7: GetSourceWithCustomReferer

 public static Uri GetSourceWithCustomReferer(Image image)
 {
     if (image == null)
     {
         throw new ArgumentNullException("Image");
     }
     return (Uri)image.GetValue(SourceWithCustomRefererProperty);
 }
开发者ID:oxcsnicho,项目名称:SanzaiGuokr,代码行数:8,代码来源:ImageProperties.cs

示例8: GetIsLoading

 public static bool GetIsLoading(Image obj)
 {
     return (bool)obj.GetValue(IsLoadingProperty);
 }
开发者ID:hexafluoride,项目名称:byteflood,代码行数:4,代码来源:Loader.cs

示例9: GetDisplayWaitingAnimationDuringLoading

 public static bool GetDisplayWaitingAnimationDuringLoading(Image obj)
 {
     return (bool)obj.GetValue(DisplayWaitingAnimationDuringLoadingProperty);
 }
开发者ID:hexafluoride,项目名称:byteflood,代码行数:4,代码来源:Loader.cs

示例10: GetErrorDetected

 public static bool GetErrorDetected(Image obj)
 {
     return (bool)obj.GetValue(ErrorDetectedProperty);
 }
开发者ID:hexafluoride,项目名称:byteflood,代码行数:4,代码来源:Loader.cs

示例11: GetDisplayOption

 public static DisplayOptions GetDisplayOption(Image obj)
 {
     return (DisplayOptions)obj.GetValue(DisplayOptionProperty);
 }
开发者ID:hexafluoride,项目名称:byteflood,代码行数:4,代码来源:Loader.cs

示例12: GetDisplayErrorThumbnailOnError

 public static bool GetDisplayErrorThumbnailOnError(Image obj)
 {
     return (bool)obj.GetValue(DisplayErrorThumbnailOnErrorProperty);
 }
开发者ID:hexafluoride,项目名称:byteflood,代码行数:4,代码来源:Loader.cs

示例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));
        }
开发者ID:thoschmidt,项目名称:shoopdoup,代码行数:8,代码来源:MainWindow.xaml.cs

示例14: GetIsSmartVisibilityEnabled

 public static bool GetIsSmartVisibilityEnabled(Image element)
 {
     return (bool)element.GetValue(IsSmartVisibilityEnabledProperty);
 }
开发者ID:jarkkom,项目名称:awfuldotnet,代码行数:4,代码来源:UIExtensions.cs

示例15: GetSource

 public static string GetSource(Image obj)
 {
     return (string)obj.GetValue(SourceProperty);
 }
开发者ID:hexafluoride,项目名称:byteflood,代码行数:4,代码来源:Loader.cs


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