php - How to draw an 8x8 square on an image? -


I have an image: image.png (can be jpg or gif)

How do I I can attract an 8x8 square on $ x, $ y and then on the image to $ file

You are searching:

  // load the image $ img = imagecreatefrompng (" image.png "); // or imagecreatefromjpeg (), etc. // $ Colors = Set a color for the side of the image colourallocate ($ img, 255, 255, 255); // Make a 8x8 recurrence on coordinates ($ x, $ y) for a white rectangle / top left picture ($ IMG, $ x, $ y, $ x + 8, $ y + 8, $ color); // Or, if you want to fill it, then use imagefilledrectangle () with the same logic // Save image image image ($ img, "image.png"); // or imagejpeg (), etc.  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -