asmrobot
2019-10-14 730fe7ea65bcadbe235e40bb54b2410d14495267
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;
        }
    }
}