<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>https://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>https://jackxiang.com/post//</link>
<title><![CDATA[用PHP做一个在线文字转图片的网站，服务与微博，下面是代码。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Php/Js/Shell/Go]]></category>
<pubDate>Fri, 06 Jun 2014 08:44:14 +0000</pubDate> 
<guid>https://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	<textarea name="code" class="php" rows="15" cols="100">
问题是，文字输入框不能转行（具体是那段代码，怎么修改尺寸，怎么把文字输入框放入页面剧中位置，怎么让回车键变成换行命令），导致图片只能显示不完整，（图片框是否也需要设置呢，最好说详细点）如图片所示。我没有基础，代码是网上找来的，最好能告诉我怎么改，越详细越好，十分感谢。

 

&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gbk&quot;&gt;
&lt;?php

if (!empty($_POST[&#039;imStr&#039;])) &#123;
&nbsp;&nbsp;&nbsp;&nbsp;$imWidth = 300;
&nbsp;&nbsp;&nbsp;&nbsp;$imHeight = 80;

&nbsp;&nbsp;&nbsp;&nbsp;$im = imagecreate($imWidth, $imHeight);
&nbsp;&nbsp;&nbsp;&nbsp;imagecolorallocate($im, 255, 255, 255);

&nbsp;&nbsp;&nbsp;&nbsp;$heiSe = imagecolorallocate($im, 0, 0, 0);
&nbsp;&nbsp;&nbsp;&nbsp;$baiSe = imagecolorallocate($im, 255, 255, 255);
&nbsp;&nbsp;&nbsp;&nbsp;$randColor = imagecolorallocate($im, rand(0, 255), rand(0, 255), rand(0, 255));

&nbsp;&nbsp;&nbsp;&nbsp;/*以下几项为图片边框，边框的宽度要占用 1px 像素*/
&nbsp;&nbsp;&nbsp;&nbsp;imageline($im, 0, 0, $imWidth, 0, $heiSe);
&nbsp;&nbsp;&nbsp;&nbsp;imageline($im, $imWidth - 1, 1000, $imWidth - 1, $imHeight, $heiSe);
&nbsp;&nbsp;&nbsp;&nbsp;imageline($im, 1000, $imHeight - 1, $imWidth, $imHeight - 1, $heiSe);
&nbsp;&nbsp;&nbsp;&nbsp;imageline($im, 1000, 1000, 1000, $imHeight, $heiSe);

 
&nbsp;&nbsp;&nbsp;&nbsp;$str = iconv(&#039;GBK&#039;, &#039;UTF-8&#039;, $_POST[&#039;imStr&#039;]);
&nbsp;&nbsp;&nbsp;&nbsp;$str1 = iconv(&#039;GBK&#039;, &#039;UTF-8&#039;, &#039;此图生存代码由 Mister Yu 编写&#039;);
 $strColor = imagecolorallocate($im, 0, 0, 0);

&nbsp;&nbsp;&nbsp;&nbsp;imagettftext($im, 10, 0, 10, 30, $strColor, &#039;./HT.TTF&#039;, $str);

&nbsp;&nbsp;&nbsp;&nbsp;/*画一条虚线*/
&nbsp;&nbsp;&nbsp;&nbsp;$lineStyle = array($heiSe, $baiSe);
&nbsp;&nbsp;&nbsp;&nbsp;imagesetstyle($im, $lineStyle);
&nbsp;&nbsp;&nbsp;&nbsp;imageline($im, 10, 50, $imWidth - 10, 50, IMG_COLOR_STYLED);
&nbsp;&nbsp;&nbsp;&nbsp;imagettftext($im, 10, 0, 10, 70, $strColor, &#039;./HT.TTF&#039;, $str1);

&nbsp;&nbsp;&nbsp;&nbsp;$imName = date(&#039;YmdHis&#039;).rand(1000, 9999).&#039;.jpg&#039;;
&nbsp;&nbsp;&nbsp;&nbsp;imagejpeg($im, $imName);
&nbsp;&nbsp;&nbsp;&nbsp;echo &#039;&lt;img src=&quot;&#039;.$imName.&#039;&quot;&gt;&#039;;
&#125; else &#123;
&nbsp;&nbsp;&nbsp;&nbsp;echo &#039;
&lt;form action=&quot;&quot; method=&quot;post&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;图片内容：&lt;input type=&quot;text&quot; name=&quot;imStr&quot; /&gt;&lt;p /&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type=&quot;submit&quot; value=&quot;转换成图片&quot; /&gt;&nbsp;&nbsp;
&lt;/form&gt;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&#039;;
&#125;

?&gt;
</textarea><br/><br/>来自：http://wenwen.sogou.com/z/q309347664.htm
]]>
</description>
</item><item>
<link>https://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] 用PHP做一个在线文字转图片的网站，服务与微博，下面是代码。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>