我想创造一个网上商店的功能,海报被出售。这家网店在Woocommerce中使用Wordpress。
请看下面的图片

它显示了一个海报模板,我希望能够根据用户输入自动生成相应的海报。这意味着应该有以下领域:
用户还应该能够通过从一定数量的数字中进行选择来在这两个数字区域中添加数字。
用户应该能够在预览中看到海报的变化,当他高兴时,用户必须将它添加到他的篮子中,最后,当他选择购买它时。海报应发送到一个特定的电子邮件地址,其中包括序号。
很明显,我不打算也不期望任何人想出一个完整的解决方案,但我需要的是一种开始的方式,我只有一个问题。
具有实时预览功能的海报一代:什么样的技术适合这项任务?我应该开始研究哪些技术才能实现想要的功能呢?
在我目前的研究中,我发现了一些叫做iTextSharp的东西,但是看起来它只适用于JAVA或C#,我需要它在运行wordpress的网站上工作,所以我想PHP需要在某种程度上参与进来。
发布于 2015-01-17 18:42:57
您可以在php中创建图像并向其添加文本:
<?php
$my_img = imagecreate( 200, 80 );
$background = `enter code here`imagecolorallocate( $my_img, 0, 0, 255 );
$text_colour = imagecolorallocate( $my_img, 255, 255, 0 );
$line_colour = imagecolorallocate( $my_img, 128, 255, 0 );
imagestring( $my_img, 4, 30, 25, "thesitewizard.com", $text_colour );
imagesetthickness ( $my_img, 5 );
imageline( $my_img, 30, 45, 165, 45, $line_colour );
header( "Content-type: image/png" );
imagepng( $my_img );
imagecolordeallocate( $line_color );
imagecolordeallocate( $text_color );
imagecolordeallocate( $background );
imagedestroy( $my_img );
?>https://stackoverflow.com/questions/28002877
复制相似问题