Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Untested... but this seems like it ought to work, composed of other gd functions (maybe slowly):</p> <pre><code>function flipImageHorizontal($im){ $width = imagesx($im); $height = imagesy($im); for($y = 0; $y &lt; $height; $y++){ // for each column for($x = 0; $x &lt; ($width &gt;&gt; 1); $x++){ // for half the pixels in the row // get the color on the left side $rgb = imagecolorat($im, $x, $y); $colors = imagecolorsforindex($im, $rgb); $current_color = imagecolorallocate($im, $colors["red"], $colors["green"], $colors["blue"]); // get the color on the right side (mirror) $rgb = imagecolorat($im, $width - $x, $y); $colors = imagecolorsforindex($im, $rgb); $mirror_color = imagecolorallocate($im, $colors["red"], $colors["green"], $colors["blue"]); // swap the colors imagesetpixel($im, $x, $y, $mirror_color); imagesetpixel($im, $width - $x, $y, $color); } } } function flipImageVertical($im){ $width = imagesx($im); $height = imagesy($im); for($x = 0; $x &lt; $width; $x++){ // for each row for($y = 0; $y &lt; ($height &gt;&gt; 1); $y++){ // for half the pixels in the col // get the color on the top $rgb = imagecolorat($im, $x, $y); $colors = imagecolorsforindex($im, $rgb); $current_color = imagecolorallocate($im, $colors["red"], $colors["green"], $colors["blue"]); // get the color on the bottom (mirror) $rgb = imagecolorat($im, $x, $height - $y); $colors = imagecolorsforindex($im, $rgb); $mirror_color = imagecolorallocate($im, $colors["red"], $colors["green"], $colors["blue"]); // swap the colors imagesetpixel($im, $x, $y, $mirror_color); imagesetpixel($im, $x, $height - $y, $color); } } } </code></pre> <p>So you could use <code>bool imagestring ( resource $image , int $font , int $x , int $y , string $string , int $color )</code> to create an image from a text string, then run it through the appropriate flip function that I've written above... </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload