Hi all. I have a png imaage and i want to add a dynamic image to it that is produced by calling an xml feed file.But i do not know how to achive that. I reached to point where i can add environmental varible to png but do now khow how to put dynamic image to it. I be happy if some one help me here.Thanks
xml that has url of dynamic image .This xml is a feed:
- <playlist>
- <song>
<artist>Artisname1</artist>
<name>SongName1</name>
<image>./song_images/artistpic1.jpg</image>
<rating>3</rating>
<songid>2624</songid>
<totalvotes>35</totalvotes>
</song>
- <song>
<artist>Artistname2</artist>
<name>SongName2</name>
<image>./song_images/artistpic2.jpg</image>
<rating>3.5</rating>
<songid>4795</songid>
<totalvotes>14</totalvotes>
</song>
</playlist>
Code:
<?php
Header ("Content-type: image/png");
$img_handle = imageCreateFromPNG("./currentimg2.png");
$color = ImageColorAllocate ($img_handle, 100, 100, 100);
$ip = $_SERVER['REMOTE_ADDR'];
ImageString ($img_handle, 3, 10, 9, "Your IP: $ip", $color);
ImagePng ($img_handle);
ImageDestroy ($img_handle);
?>
xml that has url of dynamic image .This xml is a feed:
- <playlist>
- <song>
<artist>Artisname1</artist>
<name>SongName1</name>
<image>./song_images/artistpic1.jpg</image>
<rating>3</rating>
<songid>2624</songid>
<totalvotes>35</totalvotes>
</song>
- <song>
<artist>Artistname2</artist>
<name>SongName2</name>
<image>./song_images/artistpic2.jpg</image>
<rating>3.5</rating>
<songid>4795</songid>
<totalvotes>14</totalvotes>
</song>
</playlist>