How to select the cropping area based on the four coordinate cropping methods for the image? four coordinate parameters are generated based on the juqery Image Plugin? X155&y117&x2420&y2265&fileimages1600x0000.jpg based on the four coordinate parameters, crop the original 600*1200 image in the specified area. how is the coordinate ratio calculated? For example, if the x1 coordinate is 55, the image is not cropped according to the four coordinates.
Selected crop area
Generate four coordinate parameters based on juqery image plug-in
? X1 = 55 & y1 = 17 & x2 = 420 & y2 = 265 & file = images/1600x0000.jpg
Based on the four coordinate parameters, crop the image of the original 600*1200 in the specified selection area
How is the coordinate ratio calculated? For example, if the x1 coordinate is 55, it does not mean that the x axis starts from 55 ..
In addition, how can we calculate the image size to be cropped as 1269*1033 based on the four coordinates?
How can I use the imagecopyresampled processing functions of these GD libraries? Please advise! 3Q
------ Solution --------------------
You should give the source of the tutorial
------ Solution --------------------
You need to know the parameters 1, 2, and 3.
1. the height and width of the image for cropping (the actual value of stretching/scaling)
2. the starting coordinate of the cropping frame and its length and width
3. the height and width of the image you want to generate
3. based on the zoom level, calculate the actual starting point coordinates of the source image to be cropped and the actual length and width of the cropped area in the source image.
4. use the imagecopyresampled function to get the image you need. Read the manual for parameters.
------ Solution --------------------
OK. The starting coordinates and width and height are determined if they are rectangles.