private void ShowMeshDlg() { MeshView MeshDlg = new MeshView(); // Preparte texture bitmap Point Pnt1, Pnt2; GetCroppedImageCoords(out Pnt1, out Pnt2); // Crop Left image // Need to be from actual starting i,j to last one // size has to size of this bitmap, (which should be equal to number of items in disparity times step) // we found the height for a specific number of pixels, skipping by step Pnt1.X += TemplateSz / 2 + SearchAreaX / 2; Pnt1.Y += TemplateSz / 2 + SearchAreaY / 2; Pnt2.X -= (TemplateSz / 2 + SearchAreaX / 2); Pnt2.Y -= (TemplateSz / 2 + SearchAreaY / 2); LeftImage.ROI = new Rectangle(Pnt1.X, Pnt1.Y, Pnt2.X - Pnt1.X, Pnt2.Y - Pnt1.Y); MeshDlg.SetupMeshView(Disparity, meshSize, LeftImage.ToBitmap(), Step); // Restore original image LeftImage.ROI = Rectangle.Empty; MeshDlg.Show(); }