imagesettile

Descrierea

imagesettile() sets the tile image to be
used by all region filling functions (such as imagefill()
and imagefilledpolygon()) when filling with the special
color IMG_COLOR_TILED.

A tile is an image used to fill an area with a repeated pattern. Any
GD image can be used as a tile, and by setting the transparent color index of the tile
image with imagecolortransparent(), a tile allows certain parts
of the underlying area to shine through can be created.

Notă:

You need not take special action when you are finished with a tile, but if you
destroy the tile image, you must not use the IMG_COLOR_TILED
color until you have set a new tile image!

User Contributed Notes 2 notes

If you're using a tile image that has some form of transparency you'll need to make sure your destination image is set to use alpha blending. By default it will be, but if for any reason you've changed it you'll need to do:

There is very little information about this function so I thought I'd add a few notes I found while trying to get this

working.

First make sure your version of PHP is above 4.3.2 I spent an hour searching goggles 13000+ mirrors of this same page and

finally found the info I needed at AltaVista, there is a bug in PHP 4.3.2 that makes this none functional.

if your creating the base image you need to create it with imageCreateTrueColor() if your using a PNG with transparency, I

found even nullifying the PNG's transparency with GD doesn't work. the tiling PNG has to be created without transparency to work with imageCreate(). but from what I've seen imageCreateFromXXX() can use transparent and nonetransparent PNG's.