如何解决SQL数据库中图像顶部的文本
| 所以我试图弄清楚该怎么做:http://www.hetemeel.com/einsteinform.php 以我自己的形象。我还需要弄清楚如何用从SQL数据库中获取文本替换文本框。任何帮助深表感谢。谢谢! :-)解决方法
尝试使用此脚本。
$sql = \"SELECT some_text FROM some_table LIMIT 1\";
$rs = mysql_query($sql) or die();
$arr = mysql_fetch_assoc($rs);
header (\"Content-type: image/png\");
$string = $arr[\'some_text\'];
// try changing this as well
$font = 4;
$width = imagefontwidth($font) * strlen($string) ;
$height = imagefontheight($font) ;
$im = imagecreatefrompng(\"/path/to/someimagefile\");
$x = imagesx($im) - $width ;
$y = imagesy($im) - $height;
$backgroundColor = imagecolorallocate ($im,255,255);
$textColor = imagecolorallocate ($im,0);
imagestring ($im,$font,$x,$y,$string,$textColor);
imagepng($im);
, 首先,将该图像作为div的背景图像,对于图像中显示的文本,您可以使用CSS3将文本转换为看起来像使用以下方法所看到的方式:
-webkit-transform: rotate(15deg); /* rotate the text by 15 degree for chrome */
-moz-transform: rotate(15deg); /* for mozilla */
transform: rotate(15deg); /* for future,when css3 is standard and Opera */
并使用一种字体,使它感觉像“ Buxton Sketch”字体名称一样手写。
然后使用padding-left属性将此文本放置在图像中所需的位置。
我希望这会有用。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。