PHP cropping bottom og the image -
Then I have such an image -> and I have to pull out the red area. I tried to harvest it, but the function is harvesting the whole picture, from top and bottom. So how to crop only under the image? The end result is incorrect () Here's the code:
function getWidth () {Return images x ($-this-> image); } GetHeight () function {return images ($ this-> image); } Function cutout ($ width, height $) {$ height = $ this- & gt; GetHeight () - 55; $ Width = $ this- & gt; GetWidth (); $ X = ($ this- & gt; getWidth () / 2) - ($ width / 2); $ Y = ($ this- & gt; getHyight () / 2) - ($ height / 2); Return $ -> - ($ x, $ y, $ width, height $); } Function cut ($ x, $ y, $ width, height) {$ new_image = imagecreatetruecolor ($ width, $ height); Imagecolortransparent ($ new_image, PictureCallOlock ($ new_image, 0, 0, 0)); Imagealphobalending ($ new_image, incorrect); Imesacelfa ($ new_image, true); Imagecopy ($ new_image, $ this-> image, 0, 0, $ x, $ y, $ width, $ height); $ This- & gt; Image = $ new_image; }
Comments
Post a Comment