0

好吧,我查了无数次。很多人说要使用 imagecreatefrompng('some sort of photobucket url or imgur.com'),你需要做这个函数:

$powered = imagecreatefromstring(file_get_contents('http://bowlinggreen.halfoffdeals.com/images/small_logos/bowlinggreen.png'));
$powered = imagepng($powered_by);

但是,这对我没有帮助。它给了我这个错误:

警告:imagecreatefromstring() [function.imagecreatefromstring]:第 123 行 /usr/home/dev1/public_html/inline/iframe_special_gd.php 中的空字符串或无效图像

警告:imagepng():提供的参数不是第 124 行 /usr/home/dev1/public_html/inline/iframe_special_gd.php 中的有效图像资源

警告:imagecopymerge():提供的参数不是第 129 行 /usr/home/dev1/public_html/inline/iframe_special_gd.php 中的有效图像资源

我正在尝试将此 URL 作为图像以将其合并到我当前的图像之上:

$image = imagecreatefrompng('http://dev1.mogadore-deals2.com/images/gdprac/blank_template2.png');

imagecopymerge($powered, $image, 5, 10, 5, 10, 150, 148, 100);

    imagefttext($image, 8, 0, 163, 20, $color, '../images/gdprac/LUCIDASANSSTD-BOLD.OTF', 'Your Price:');
    imagefttext($image, 22, 0, 163, 48, $color, '../images/gdprac/LUCIDASANSSTD.OTF', '$'.$selling_price);
    imagefttext($image, 7, 0, 168, 70, $color, '../images/gdprac/LUCIDASANSSTD.OTF', 'Original Price');
    imagefttext($image, 11, 0, 182, 90, $color, '../images/gdprac/LUCIDASANSSTD.OTF', '$'.$certificate_value);
    imagefttext($image, 7, 0, 248, 70, $color, '../images/gdprac/LUCIDASANSSTD.OTF', 'Savings');
    imagefttext($image, 11, 0, 250, 90, $color, '../images/gdprac/LUCIDASANSSTD.OTF', '50%');
    imagefttext($image, 7, 0, 163, 153, $color, '../images/gdprac/LUCIDASANSSTD.OTF', 'Powered by:');

imagepng($image, '../images/gdprac/final_temp.png');
4

0 回答 0