You need to calculate the 3rd and 4th number (width and height of the window) by saying
widthImg=x2-x1;
heightImg=y2-y1;
using image() with 5 parameters is always slower than
using it with 3 parameters, so you want to use resize command
You need to calculate the 3rd and 4th number (width and height of the window) by saying
widthImg=x2-x1;
heightImg=y2-y1;
using image() with 5 parameters is always slower than
using it with 3 parameters, so you want to use resize command