开发者

Create a marquee text GIF

开发者 https://www.devze.com 2023-03-17 11:43 出处:网络
I know this will take up a lot of bandwidth but I\'m willing to do that. Currently I have a script that will take a number of images and make them into a gif.

I know this will take up a lot of bandwidth but I'm willing to do that.

Currently I have a script that will take a number of images and make them into a gif.

And I know how to create a image with text.

I need a function that takes text and scrolls it horizontally fro开发者_JAVA技巧m right to left.


Just create a loop through the x coordinates of the image. Example ($im is your image, text is a function which writes text to $im at the given x,y coordinates):

$image_width=imagesx($im);//get width of image
$increment=5;//get increment of text scroll
for($i=0;$i<$image_width;$i+=$increment){//loops the image pixels
text(0,$i);//calls the function text which should draw text to $im at the given coordinates
}

Please ask if you don't know how to implement the text function.


Although this solution is outdated and universally hated super oldskool, it really does sound like you're actually looking for the html <marquee> tag.

<marquee>this text will scroll from right to left!!!</marquee>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号