Exemple #1
0
        public static byte[] GetCroppedImageData(RegionCapture regionCapture)
        {
            BitmapSource bitmapSource = new CroppedBitmap(regionCapture.ScreenCapture, new Int32Rect((int)regionCapture.Position.X, (int)regionCapture.Position.Y,
                                                                                                     (int)regionCapture.SelectedRegion.Width, (int)regionCapture.SelectedRegion.Height));

            return(Helper.GetMemoryFromBitmapSource(bitmapSource));
        }
Exemple #2
0
        private void ScreenCaptureGrid_MouseUp(object sender, MouseButtonEventArgs e)
        {
            IsMouseDown = false;

            SelectedRegion = new Rectangle()
            {
                Width  = selectionBox.Width,
                Height = selectionBox.Height
            };
            RectPosition = new Point()
            {
                X = Canvas.GetLeft(selectionBox),
                Y = Canvas.GetTop(selectionBox)
            };

            RegionCaptureData = new RegionCapture()
            {
                ScreenCapture  = ScreenCaptureFull,
                Position       = RectPosition,
                SelectedRegion = this.SelectedRegion,
                LanguageOCR    = this.LanguageOCR,
            };

            this.Hide();
            ResetSelectionBox();
            ShowResult(Rescan);
        }
Exemple #3
0
        public ChefBotForm()
        {
            InitializeComponent();
            rg = new RegionCapture();
            rg.CaptureFinished += Rg_CaptureFinished;
            this.Load          += ChefBotForm_Load;

            chef      = new ak.component.Chef();
            tempaltes = new List <Bitmap>();
        }
Exemple #4
0
    void Start()
    {
        RenderTextureCamera = Region_Capture.GetComponentInChildren <Camera>();

        regionCapture = Region_Capture.GetComponent <RegionCapture> ();

        Console.Out.WriteLine("Starting region capture !");

        if (FreezeEnable)
        {
            regionCapture.Check_OutOfBounds = true;
        }

        StartCoroutine(WaitForTexture());
    }