有没有什么方法可以用javascript或jquery将文本(字符串)转换成图像?我找不到任何方法来做这件事。最好的是什么?
我不想使用php或asp.net来做这件事。感谢你的任何技巧和帮助。
发布于 2011-11-28 15:09:20
使用canvas
元素和draw text onto it。
发布于 2011-11-28 15:33:53
用php从字符串创建图像
<?php
// Create a 100*30 image
$im = imagecreate(100, 30);
// White background and blue text
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 255);
// Write the string at the top left
imagestring($im, 5, 0, 0, 'Hello world!', $textcolor);
// Output the image
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
更多信息here
https://stackoverflow.com/questions/8292474
复制相似问题