Exemplo n.º 1
0
        public Point?Find(bool highlight)
        {
            this.bitmap = WowScreen.GetCroppedBitmap(highlight);

            Score?best = Score.ScorePoints(FindYellowPoints());

            var e = new NodeEventArgs()
            {
                Bitmap = this.bitmap
            };

            if (best != null && best.count > 2)
            {
                e.Point = best.point;
            }

            NodeEvent?.Invoke(this, e);

            this.bitmap.Dispose();

            return(best?.point);
        }
Exemplo n.º 2
0
        private void RenderColour(bool renderMatchedArea)
        {
            var bitmap = new System.Drawing.Bitmap(256, 256);

            var points = new List <Point>();

            for (var b = 0; b < 256; b++)
            {
                for (var g = 0; g < 256; g++)
                {
                    if (pixelClassifier.IsMatch((byte)this.YellowValue, (byte)g, (byte)b))
                    {
                        points.Add(new Point(b, g));
                    }
                    bitmap.SetPixel(b, g, System.Drawing.Color.FromArgb(this.YellowValue, g, b));
                }
            }

            if (ScreenCapture == null)
            {
                ScreenCapture     = WowScreen.GetCroppedBitmap(false);
                renderMatchedArea = true;
            }

            this.WowScreenshot.Source = ScreenCapture.ToBitmapImage();

            if (renderMatchedArea)
            {
                Dispatch(() =>
                {
                    Bitmap bmp = new Bitmap(ScreenCapture);
                    MarkYellowOnBitmap(bmp);
                    this.WowScreenshot.Source = bmp.ToBitmapImage();
                });
            }
        }
Exemplo n.º 3
0
 private void Capture()
 {
     ScreenCapture = WowScreen.GetCroppedBitmap(false);
     RenderColour(true);
 }