Пример #1
0
        private Bitmap DetectStartPoint(MemoryStream pngStream)
        {
            if (!HasAndroid)
            {
                return(null);
            }
            Bitmap bmpfix = null;

            using (var img = Image.FromStream(pngStream))
            {
                Bitmap  bmp = new Bitmap(img);
                CAPTCHA c   = new CAPTCHA(bmp);
                StartX = (int)(c.DetectX / ResolutionXScale) - 8;
                StartY = (int)(c.DetectY / ResolutionYScale) + 6;
                string xyText = "(" + StartX.ToString() + "," + StartY.ToString() + ")";

                bmpfix = new Bitmap(c.bmp).Clone() as Bitmap;
                using (Graphics g = Graphics.FromImage(bmpfix))
                {
                    using (Font font = new Font("Arial", 36))
                    {
                        g.DrawString(xyText, font, Brushes.Red, new PointF(10, 30));
                    }
                }
            }
            return(bmpfix);
        }
Пример #2
0
        private Bitmap DetectStartPoint(MemoryStream pngStream)
        {
            if (!HasAndroid)
            {
                return(null);
            }
            Bitmap bmpfix = null;

            using (var img = Image.FromStream(pngStream))
            {
                Bitmap  bmp = new Bitmap(img);
                CAPTCHA c   = new CAPTCHA(bmp);
                StartX = (int)(c.DetectX / ResolutionXScale) - 8;
                StartY = (int)(c.DetectY / ResolutionYScale) + 6;

                bmpfix = new Bitmap(c.bmp).Clone() as Bitmap;
            }
            return(bmpfix);
        }