Jump to content

Filling an area with an image


PhaZZed

Recommended Posts

Greetings all,

 

Yesterday I got some text -> image code working, which basically takes a text value and converts it to an image with a font of choice, the example may be viewed here.. http://www.trafficmagic.co.uk/glitter/glitter.php - now what I would like to do, is fill the black areas (ie. the font) with another image, here's an example: http://www.imod.co.za/glitter.gif..

 

Any help would be greatly appreciated..

Link to comment
https://forums.phpfreaks.com/topic/79401-filling-an-area-with-an-image/
Share on other sites

Hmm, thats an interesting one. It would seem to me that the font layer would need to be rasterised, made transparent, masked, then the other image placed underneath it. However, how you achieve this using php/GD2 i don't have the foggiest. Hopefully my comments will spark some research off for yourself.

would this not be done by  javascript or css?

 

Probably not CSS because that text is not actually text in this case it's a .gif image.

 

-----

 

PhaZZed: On that glitter text site they always have white stars flying around in them; however if you change the font color to white there are no stars. :o

 

My guessing is that they have used layers. A layer than constantly has the flying stars in it, and a layer on top hiding it that makes transparent shapes of the letters; thus showing the underneath layer on only the points of the letters... It's the colour of the bottom layer that changes thus does not show up white... That's a theory anyway... as to how do it? I have no idea. :P I could probably work something out but it'd take a while.

 

Sam

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.