asmrobot
2019-10-29 f25f89101a98ad815c0ae2d25e1a8dc35d53a5dd
src/RichCreator.Utility/CV/CVHelper.cs
@@ -10,6 +10,7 @@
using System.Text;
using System.Threading.Tasks;
using Orientation = RichCreator.Utility.Structs.Orientation;
using RichCreator.Utility.Captures;
namespace RichCreator.Utility.CV
{
@@ -848,6 +849,39 @@
        }
        #endregion
        /// <summary>
        /// 是否在指定颜色在区域内
        /// </summary>
        /// <returns></returns>
        public static bool RectExistsArray(ZTRectangle rect,ColorArray colorArray)
        {
            ZTRectangle colorRect = ZTRectangle.Empty;
            return RectExistsArray(out colorRect, rect, colorArray);
        }
        /// <summary>
        /// 是否在指定颜色在区域内
        /// </summary>
        /// <returns></returns>
        public static bool RectExistsArray(out ZTRectangle arrayRect,ZTRectangle rect, ColorArray colorArray)
        {
            //截图
            System.Drawing.Bitmap bitmap = ScreenCapture.Instance.CaptureScreen();
            Image<Rgb, byte> image = new Image<Rgb, byte>(bitmap);
            //查找地图右上边是否存在时空之门文字
            if (CVHelper.FindColorArray(out arrayRect, image, colorArray, rect))
            {
                return true;
            }
            return false;
        }
    }
}