本文介绍了PHP:创建一个平滑的边缘,图像或字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我用过:

 <?php 
imagefilledellipse($ image,$ cx,$ cy,$ w,$ h,$ color);
?>

但讨厌它产生的粗糙边缘。所以我正在考虑制作或使用我将要输出的圆形字体:

 <?php 
imagettftext ($ image,$ size,$ angle,$ x,$ y,$ color,'fontfile.ttf',$ text);
?>

这样字体会产生一个光滑边缘的圆。我的问题是使字体大小匹配半径大小。

任何想法?或者,也许一个PHP的类,会产生圆滑的边缘将是伟大的!



谢谢。

解决方案

聪明的想法,我喜欢!

但是,也许这个PHP类已经做到了:


I'm making a PHP image script that will create circles at a given radius.

I used:

<?php
imagefilledellipse ( $image, $cx, $cy, $w, $h, $color );
?>

but hate the rough edges it produces. So I was thinking of making or using a circle font that I will output using:

<?php
 imagettftext ( $image, $size, $angle, $x, $y, $color, 'fontfile.ttf', $text );
?>

So that the font will produce a circle that has a smooth edge. My problem is making the "font size" match the "radius size".

Any ideas? Or maybe a PHP class that will produce a smooth edge on a circle would be great!

Thank you.

解决方案

Clever idea, I like that!

But maybe this PHP class already does the trick: Antialiased filled Arcs/Ellipses for PHP (GD)

这篇关于PHP:创建一个平滑的边缘,图像或字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 12:24
查看更多