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


C# UITestControl.CaptureImage方法代码示例

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


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

示例1: IsActivityIconVisible

 /// <summary>
 /// Determines whether [is activity icon visible] [the specified activity].
 /// </summary>
 /// <param name="activity">The activity.</param>
 /// <returns></returns>
 public bool IsActivityIconVisible(UITestControl activity)
 {
     const string ActivityDefaultGrey = "ffe9ecee";
     var pixelGrabber = new Bitmap(activity.CaptureImage());
     var thePixel = pixelGrabber.GetPixel(10, 10).Name;
     return thePixel != ActivityDefaultGrey;
 }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:12,代码来源:WorkflowDesignerUIMap.cs

示例2: AssignControl_IsLeftTextBoxHighlightedRed

 /// <summary>
 /// Assigns the control_ is left text box highlighted red.
 /// </summary>
 /// <param name="leftTextBox">The left text box.</param>
 /// <returns></returns>
 public bool AssignControl_IsLeftTextBoxHighlightedRed(UITestControl leftTextBox)
 {
     var pixelGrabber = new Bitmap(leftTextBox.CaptureImage());
     return pixelGrabber.GetPixel(5, 0) == Color.Red;
 }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:10,代码来源:WorkflowDesignerUIMap.cs

示例3: IsIconVisible

        /// <summary>
        /// Determines whether [is icon visible] [the specified tool].
        /// NOTE : Crap method. If icon has a lot of white in it it will fail ;)
        /// </summary>
        /// <param name="tool">The tool.</param>
        /// <returns></returns>
        public bool IsIconVisible(UITestControl tool)
        {
            const string White = "ffffffff";
            var pixelGrabber = new Bitmap(tool.CaptureImage());
            var result = false;

            //must find some color after 3 pixel grabs

            //first pass
            Mouse.Move(tool, new Point(24, 9));
            var thePixel = pixelGrabber.GetPixel(24, 9).Name;
            result = thePixel != White;

            //second pass
            Mouse.Move(tool, new Point(25, 10));
            thePixel = pixelGrabber.GetPixel(25, 10).Name;
            result = result || thePixel != White;

            //third pass
            Mouse.Move(tool, new Point(26, 21));
            thePixel = pixelGrabber.GetPixel(24, 11).Name;
            result = result || thePixel != White;

            return result;
        }
开发者ID:Robin--,项目名称:Warewolf,代码行数:31,代码来源:ToolboxUIMap.cs


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