|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-07-10 11:59 UTC] jakmania at libertysurf dot fr
Description:
------------
If you "imagesettile" on an image created through "imagecreate" then use "imagefill" and "IMG_COLOR_TILED" as color as explained in the documentation, it's fine. But if the basic image is not created on the fly, eg. it is imported through "imagecreatefromXXX" then your "tile image" won't be apply on that image :-)
NB: any version of GD, even the bundled one.
See an example of NOT working code below.
Thanx
Reproduce code:
---------------
<?php
header ("Content-type: image/png");
$im = imagecreatefrompng("basic.png"); /* 200 x 200 */
$im = imagecreatefrompng("tile.png"); /* 10 x 10 */
imagesettile($im, $tily);
imagefill($im,110,90,IMG_COLOR_TILED);
imagepng($im);
imagedestroy($im);
?>
Expected result:
----------------
basic.png (a map in fact) tiled on a delimited area (a country).
Actual result:
--------------
Just the basic image (basic.png), not tiled at all.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 19:00:01 2025 UTC |
Here's my test script: <?php header ("Content-type: image/png"); $im = imagecreatefrompng("basic.png"); /* 200 x 200 */ $tile = imagecreatefrompng("tile.png"); /* 10 x 10 */ imagesettile($im, $tile); // imagefilledpolygon ($im, array(0,0,200,0,200,200,0,200), 4, IMG_COLOR_TILED); // Works // imagefilledrectangle ($im, 10,10,190,190, IMG_COLOR_TILED); // Works imagefill($im,10,10,IMG_COLOR_TILED); // Does not work? imagepng($im); ?> But when I used imagefill(), it only draw one line in the top with the tile and the tile image was somewhat scaled down..(I'm not sure if it's supposed to work like this? :) # file tile.png tile.png: PNG image data, 10 x 10, 8-bit/color RGB, non-interlaced # file basic.png basic.png: PNG image data, 200 x 200, 8-bit/color RGB, non-interlaced