Jump to content

Recommended Posts

Hi Im trying to creat links inside of a imagefilledpolygon but its not working right anyone know how to do this im confused as how to otherwise.

 

<?php
ini_set('display_errors', '1');
error_reporting(E_ALL);
header("Content-type: image/png");
$im = imagecreate(158, 410);
$points1 = array(51,59,52,52,51,46,46,37,43,27,48,27,52,24,50,21,51,17,53,14,53,18,56,18,61,12,67,8,72,8,75,7,79,8,84,11,87,14,89,15,90,12,92,13,93,17,95,16,95,28,97,26,98,31,95,37,93,41,91,54,90,62,88,58,86,55,84,57,83,59,81,61,77,64,75,65,71,64,69,62,66,59,65,61,64,65,62,66,60,63,58,59,55,56);
$points2 = array(51,71,54,70,57,68,59,67,60,63,62,66,64,65,65,61,66,59,69,62,71,64,75,65,77,64,81,61,83,59,83,62,84,64,84,66,86,68,89,70,92,70,94,72,96,74,92,77,89,79,85,81,83,82,68,82,64,81,61,80,58,78,55,76,52,73);
$points3 = array(20,283,24,285,27,287,32,287,38,288,43,288,41,301,40,306,41,311,40,317,38,325,36,331,35,335,33,338,31,348,30,354,29,361,28,362,24,364,18,364,15,361,13,360,12,351,11,346,10,338,11,320,12,316,12,307,13,305,17,292);
$points4 = array(13,360,15,361,18,364,24,364,27,362,29,361,30,366,31,369,32,372,33,376,33,379,34,384,34,389,35,393,36,399,35,402,32,402,28,404,26,407,23,408,21,406,11,406,9,404,7,403,5,399,5,395,6,391,7,387,8,384,10,379,11,372,12,367);
$points5 = array(126,362,130,363,134,363,139,362,142,360,144,360,146,365,148,370,149,375,152,378,151,381,153,386,154,389,155,393,154,398,152,400,148,400,144,401,141,403,137,406,131,404,127,400,125,399,121,397,120,393,121,390,122,386,123,381,123,375,124,366,125,363);
$points6 = array(41,76,43,78,44,81,45,114,44,119,44,129,42,132,40,136,38,141,37,144,36,150,32,149,29,148,26,146,24,144,21,144,21,136,22,132,22,119,24,115,25,111,24,107,23,101,23,86,25,80,26,86,28,83,33,81,37,78);
$points7 = array(107,77,109,78,113,80,116,79,118,79,121,78,124,78,129,80,128,82,128,87,133,87,133,94,143,95,138,102,132,105,130,107,133,111,131,114,130,120,133,119,134,125,133,127,135,129,130,141,128,143,124,144,118,144,115,146,111,147,110,145,109,141,108,137,105,123,104,114,103,108,104,102,104,96,105,90,105,84,106,80);
$points8 = array(21,141,24,144,26,146,29,148,32,149,36,150,37,155,35,165,35,168,33,172,30,176,27,181,26,186,25,191,25,196,20,197,17,197,12,198,11,180,12,165,14,155,15,152,17,146,19,142);
$points9 = array(12,198,17,197,20,197,25,196,27,199,29,202,29,214,27,217,27,227,25,229,24,226,23,224,21,224,22,227,24,231,24,234,23,235,20,234,22,237,22,240,21,241,17,239,16,240,13,238,11,234,10,223,11,213,10,206,11,201);
$points10 = array(108,294,110,293,116,295,120,296,125,293,129,291,131,290,132,288,135,293,137,298,139,305,141,309,142,314,141,319,143,327,143,350,144,354,144,360,142,360,139,362,134,363,130,363,126,362,125,357,124,351,125,348,122,343,119,337,117,328,115,324,112,316,109,310,109,303,108,298);
$points11 = array(111,147,115,146,118,144,124,144,128,143,130,141,133,144,135,143,136,140,138,141,138,148,140,151,141,153,143,160,143,164,142,174,142,176,145,178,151,171,152,172,148,173,144,189,145,191,148,190,150,191,153,191,154,193,152,195,148,197,146,199,143,202,142,204,141,207,138,204,135,201,131,199,127,199,123,200,121,197,121,193,119,191,117,187,115,182,115,179,113,176,111,170,110,163,110,159,111,156);
$points12 = array(123,200,127,199,135,201,138,204,141,207,142,213,143,219,143,221,142,224,140,228,138,230,135,232,131,233,125,234,121,230,120,227,118,224,118,218,118,213,120,207,121,203);
$points13 = array(51,71,52,73,55,76,58,78,61,80,64,81,68,82,83,82,85,81,89,79,92,77,96,74,100,75,103,76,105,76,107,77,106,80,105,84,105,90,104,96,104,102,103,108,104,114,103,119,101,124,100,129,99,136,99,143,101,155,101,161,103,165,106,170,108,179,109,183,110,187,111,189,115,193,114,194,112,195,108,192,104,191,100,189,97,188,94,186,92,185,92,189,89,192,83,193,77,193,72,193,67,192,60,191,54,189,49,187,43,188,35,190,34,188,36,183,37,179,38,174,40,169,42,165,44,161,45,158,46,156,47,152,46,134,46,130,44,127,45,119,44,114,43,81,41,78,44,76,46,73,49,72);
$points14 = array(72,234,69,238,66,242,62,250,57,256,52,264,49,271,47,277,45,284,43,288,38,288,32,287,27,287,24,285,20,283,19,279,19,273,20,266,20,253,24,240,25,234,27,229,29,223,30,216,32,209,34,195,35,190,43,188,49,187,54,189,60,191,67,192,72,193);
$points15 = array(72,193,83,193,89,192,92,189,92,185,94,186,97,188,100,189,104,191,108,192,112,195,115,199,115,207,115,212,116,215,118,218,118,224,120,227,121,230,123,237,126,242,127,248,129,256,129,265,130,271,130,277,132,288,131,290,129,291,125,293,120,296,116,295,110,293,108,294,106,291,104,282,103,279,79,241,75,238,72,234);
$vertices1 = count($points1) / 2;
$vertices2 = count($points2) / 2;
$vertices3 = count($points3) / 2;
$vertices4 = count($points4) / 2;
$vertices5 = count($points5) / 2;
$vertices6 = count($points6) / 2;
$vertices7 = count($points7) / 2;
$vertices8 = count($points8) / 2;
$vertices9 = count($points9) / 2;
$vertices10 = count($points10) / 2;
$vertices11 = count($points11) / 2;
$vertices12 = count($points12) / 2;
$vertices13 = count($points13) / 2;
$vertices14 = count($points14) / 2;
$vertices15 = count($points15) / 2;
$color1 =  imagecolorallocate($im, 255, 0, 0);
$color2 =  imagecolorallocate($im, 247, 0, 20);
$color3 =  imagecolorallocate($im, 240, 0, 40);
$color4 =  imagecolorallocate($im, 220, 0, 60);
$color5 =  imagecolorallocate($im, 200, 0, 80);
$color6 =  imagecolorallocate($im, 180, 0, 100);
$color7 =  imagecolorallocate($im, 160, 0, 120);
$color8 =  imagecolorallocate($im, 140, 0, 140);
$color9 =  imagecolorallocate($im, 120, 0, 160);
$color10 =  imagecolorallocate($im, 100, 0, 180);
$color11 =  imagecolorallocate($im, 80, 0, 200);
$color12 =  imagecolorallocate($im, 60, 0, 220);
$color13 =  imagecolorallocate($im, 40, 0, 240);
$color14 =  imagecolorallocate($im, 20, 0, 247);
$color15 =  imagecolorallocate($im, 0, 0, 250);
imagefilledpolygon($im, $points1, $vertices1, $color1);
imagefilledpolygon($im, $points2, $vertices2, $color2);
imagefilledpolygon($im, $points3, $vertices3, $color3);
imagefilledpolygon($im, $points4, $vertices4, $color4);
imagefilledpolygon($im, $points5, $vertices5, $color5);
imagefilledpolygon($im, $points6, $vertices6, $color6);
imagefilledpolygon($im, $points7, $vertices7, $color7);
imagefilledpolygon($im, $points8, $vertices8, $color8);
imagefilledpolygon($im, $points9, $vertices9, $color9);
imagefilledpolygon($im, $points10, $vertices10, $color10);
imagefilledpolygon($im, $points11, $vertices11, $color11);
imagefilledpolygon($im, $points12, $vertices12, $color12);
imagefilledpolygon($im, $points13, $vertices13, $color13);
imagefilledpolygon($im, $points14, $vertices14, $color14);
imagefilledpolygon($im, $points15, $vertices15, $color15);
imagepng($im);
?> 
<map name="try2">
<area shape="poly" alt="1" coords="51,59,52,52,51,46,46,37,43,27,48,27,52,24,50,21,51,17,53,14,53,18,56,18,61,12,67,8,72,8,75,7,79,8,84,11,87,14,89,15,90,12,92,13,93,17,95,16,95,28,97,26,98,31,95,37,93,41,91,54,90,62,88,58,86,55,84,57,83,59,81,61,77,64,75,65,71,64,69,62,66,59,65,61,64,65,62,66,60,63,58,59,55,56" href="1">
<area shape="poly" alt="2" coords="51,71,54,70,57,68,59,67,60,63,62,66,64,65,65,61,66,59,69,62,71,64,75,65,77,64,81,61,83,59,83,62,84,64,84,66,86,68,89,70,92,70,94,72,96,74,92,77,89,79,85,81,83,82,68,82,64,81,61,80,58,78,55,76,52,73" href="2">
<area shape="poly" alt="3" coords="20,283,24,285,27,287,32,287,38,288,43,288,41,301,40,306,41,311,40,317,38,325,36,331,35,335,33,338,31,348,30,354,29,361,28,362,24,364,18,364,15,361,13,360,12,351,11,346,10,338,11,320,12,316,12,307,13,305,17,292" href="3">
<area shape="poly" alt="4" coords="13,360,15,361,18,364,24,364,27,362,29,361,30,366,31,369,32,372,33,376,33,379,34,384,34,389,35,393,36,399,35,402,32,402,28,404,26,407,23,408,21,406,11,406,9,404,7,403,5,399,5,395,6,391,7,387,8,384,10,379,11,372,12,367" href="4">
<area shape="poly" alt="5" coords="126,362,130,363,134,363,139,362,142,360,144,360,146,365,148,370,149,375,152,378,151,381,153,386,154,389,155,393,154,398,152,400,148,400,144,401,141,403,137,406,131,404,127,400,125,399,121,397,120,393,121,390,122,386,123,381,123,375,124,366,125,363" href="5">
<area shape="poly" alt="6" coords="41,76,43,78,44,81,45,114,44,119,44,129,42,132,40,136,38,141,37,144,36,150,32,149,29,148,26,146,24,144,21,144,21,136,22,132,22,119,24,115,25,111,24,107,23,101,23,86,25,80,26,86,28,83,33,81,37,78" href="6">
<area shape="poly" alt="7" coords="107,77,109,78,113,80,116,79,118,79,121,78,124,78,129,80,128,82,128,87,133,87,133,94,143,95,138,102,132,105,130,107,133,111,131,114,130,120,133,119,134,125,133,127,135,129,130,141,128,143,124,144,118,144,115,146,111,147,110,145,109,141,108,137,105,123,104,114,103,108,104,102,104,96,105,90,105,84,106,80" href="7">
<area shape="poly" alt="8" coords="21,141,24,144,26,146,29,148,32,149,36,150,37,155,35,165,35,168,33,172,30,176,27,181,26,186,25,191,25,196,20,197,17,197,12,198,11,180,12,165,14,155,15,152,17,146,19,142" href="8">
<area shape="poly" alt="9" coords="12,198,17,197,20,197,25,196,27,199,29,202,29,214,27,217,27,227,25,229,24,226,23,224,21,224,22,227,24,231,24,234,23,235,20,234,22,237,22,240,21,241,17,239,16,240,13,238,11,234,10,223,11,213,10,206,11,201" href="9">
<area shape="poly" alt="10" coords="108,294,110,293,116,295,120,296,125,293,129,291,131,290,132,288,135,293,137,298,139,305,141,309,142,314,141,319,143,327,143,350,144,354,144,360,142,360,139,362,134,363,130,363,126,362,125,357,124,351,125,348,122,343,119,337,117,328,115,324,112,316,109,310,109,303,108,298" href="10">
<area shape="poly" alt="11" coords="111,147,115,146,118,144,124,144,128,143,130,141,133,144,135,143,136,140,138,141,138,148,140,151,141,153,143,160,143,164,142,174,142,176,145,178,151,171,152,172,148,173,144,189,145,191,148,190,150,191,153,191,154,193,152,195,148,197,146,199,143,202,142,204,141,207,138,204,135,201,131,199,127,199,123,200,121,197,121,193,119,191,117,187,115,182,115,179,113,176,111,170,110,163,110,159,111,156" href="11">
<area shape="poly" alt="12" coords="123,200,127,199,135,201,138,204,141,207,142,213,143,219,143,221,142,224,140,228,138,230,135,232,131,233,125,234,121,230,120,227,118,224,118,218,118,213,120,207,121,203" href="12">
<area shape="poly" alt="13" coords="51,71,52,73,55,76,58,78,61,80,64,81,68,82,83,82,85,81,89,79,92,77,96,74,100,75,103,76,105,76,107,77,106,80,105,84,105,90,104,96,104,102,103,108,104,114,103,119,101,124,100,129,99,136,99,143,101,155,101,161,103,165,106,170,108,179,109,183,110,187,111,189,115,193,114,194,112,195,108,192,104,191,100,189,97,188,94,186,92,185,92,189,89,192,83,193,77,193,72,193,67,192,60,191,54,189,49,187,43,188,35,190,34,188,36,183,37,179,38,174,40,169,42,165,44,161,45,158,46,156,47,152,46,134,46,130,44,127,45,119,44,114,43,81,41,78,44,76,46,73,49,72" href="13">
<area shape="poly" alt="14" coords="72,234,69,238,66,242,62,250,57,256,52,264,49,271,47,277,45,284,43,288,38,288,32,287,27,287,24,285,20,283,19,279,19,273,20,266,20,253,24,240,25,234,27,229,29,223,30,216,32,209,34,195,35,190,43,188,49,187,54,189,60,191,67,192,72,193" href="14">
<area shape="poly" alt="15" coords="72,193,83,193,89,192,92,189,92,185,94,186,97,188,100,189,104,191,108,192,112,195,115,199,115,207,115,212,116,215,118,218,118,224,120,227,121,230,123,237,126,242,127,248,129,256,129,265,130,271,130,277,132,288,131,290,129,291,125,293,120,296,116,295,110,293,108,294,106,291,104,282,103,279,79,241,75,238,72,234" href="15">
<img src="try2.php" width="158" height="410" border="0" usemap="#try2">
[\code]

Link to comment
https://forums.phpfreaks.com/topic/70193-png-images/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.