doudi2833 2011-04-25 12:20
浏览 257
已采纳

如何创建壁纸

We have some image and we want to create different sized wallpapers from it, like 800x600, 1024x768 or 1600x1200.

For example, we have this image http://colourlovers.com.s3.amazonaws.com/images/patterns/1440/1440297.png?1303733122

How do we create wallpapers by php?

So the patterns are tiled backgrounds, they are repeated in all axes, we start from the top:0 and left:0 and continue while it doesn't fit needed size.

Here is an example, in the right block (get this pattern image) http://www.colourlovers.com/pattern/1440297/Spring_Forward

  • 写回答

2条回答 默认 最新

  • dongyuan1970 2011-04-25 12:33
    关注
    $width = 1440;
    $height = 900;
    
    $pattern = imagecreatefrompng('1440297.png');
    $image = imagecreatetruecolor($width, $height);
    
    imagesettile($image, $pattern);
    imagefill($image, 0, 0, IMG_COLOR_TILED);
    
    header('Content-type: image/png');
    imagepng($image);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度