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)); }
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); }
public ChefBotForm() { InitializeComponent(); rg = new RegionCapture(); rg.CaptureFinished += Rg_CaptureFinished; this.Load += ChefBotForm_Load; chef = new ak.component.Chef(); tempaltes = new List <Bitmap>(); }
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()); }