QImage MainWindow::CropImage(QImage img, int x, int y, int width, int height) { return img.copy(x, y, width, height); }