", $vers);
//file_put_contents("ideasfrom.yyy", "" . $coltoget . " | ?in? " . $versus);
if (strpos($vers, "" . $coltoget . " | ") !== false) {
//file_put_contents("ideasfrom.zzz", $_GET['findmecolour']);
$rest=explode("" . $coltoget . " | ", $vers); //us[1]);
$andthen=explode("", $rest[1]);
$r_g_b=explode(" ", str_replace("", "", str_replace(" ", "", str_replace("\n", "", $andthen[0]))));
$xris=strval(hexdec($r_g_b[0]));
$xgis=strval(hexdec($r_g_b[1]));
$xbis=strval(hexdec($r_g_b[2]));
//file_put_contents("ideasfrom.www", $xris . " " . $xgis . " " . $xbis);
return imagecolorallocate($im, $xris, $xgis, $xbis);
}
}
return null;
}
function arrdo() {
$arrb = "\n var arrb=['pink','#ffc0cb'";
if (file_exists("ideasfrom.txt")) {
$vers=strtolower(file_get_contents("ideasfrom.txt"));
$codetds=explode(" | ", $vers);
for ($ik=2; $ik<(-1 + sizeof($codetds)); $ik+=2) {
$names=explode("", str_replace(""," | ",$codetds[0 + $ik]));
$r_g_b=explode(" ", str_replace("", "", str_replace(" ", "", str_replace("\n", "",$codetds[$ik]))));
$arrb .= str_replace("\n","","," . "'" . $names[-3 + sizeof($names)] . "','#" . substr(("0" . $r_g_b[0]), (strlen($r_g_b[0]) - 1)) . substr(("0" . $r_g_b[1]), (strlen($r_g_b[1]) - 1)) . substr(("0" . $r_g_b[2]), (strlen($r_g_b[2]) - 1))) . "'\n";
}
}
$arrb .= "]; \n";
return $arrb;
}
function reorderar($gin) {
global $torder, $translate, $scale;
$outgin=$gin;
$outg="";
if ($torder != "" && strpos($gin, "transform=") !== false) {
$outg=explode("transform=", $gin)[0] . 'transform=';
$bits=explode(",",str_replace(($torder . "~"), ",~", $torder));
if (sizeof($bits) > 1) {
$subgin="";
$dsubgin="";
for ($ii=0; $ii", explode('transform=', $gin)[1])[0];
$outgin=str_replace($outg, $subgin, $gin);
}
}
return $outgin;
}
function saveit($drawwhat) {
global $hp1,$p1,$p2,$p3,$p4,$p5,$p6,$p7,$p8,$p9,$p10,$p11,$p12,$p13,$p14,$p15,$p16,$p17,$p18,$p19,$p20,$prepre,$previous,$gbefore,$gafter,$rotate,$rotateappend,$scale,$translate,$matrix,$skewx,$skewy,$torder,$fld,$animatemode,$animateto,$animatefrom,$animatepath,$animateothers;
$imgname="";
//file_put_contents("ideasfrom.zzz", "0 " . $drawwhat);
if ($drawwhat == "Text") {
$imgname="animage_" . str_replace(".", "_", str_replace(":", "_", server_remote_addr())) . ".jpg";
//if (file_exists($imgname)) unlink($imgname);
$iois=imagecreatetruecolor($p1, $p1);
$ourp5=fmc($iois, $p4);
//$ourp5=imagecolorallocate($iois, $ris, $bis, $gis); // vs red
imagestring($iois, 3, $p1, $p2, $p3, $p4);
imagejpeg($iois, $imgname);
imagedestroy($iois);
return $imgname;
} else if ($drawwhat == "Circle") {
$imgname="animage_" . str_replace(".", "_", str_replace(":", "_", server_remote_addr())) . ".jpg";
//if (file_exists($imgname)) unlink($imgname);
$iois=imagecreatetruecolor($p1, $p1);
$ourp5=fmc($iois, $p5);
//$ourp5=imagecolorallocate($iois, $ris, $bis, $gis); // vs red
imagefilledarc($iois, $p2, $p3, $p4, $p4, 0, 360, $ourp5, IMG_ARC_PIE);
imagejpeg($iois, $imgname);
imagedestroy($iois);
return $imgname;
} else if ($drawwhat == "Rectangle") {
$imgname="animage_" . str_replace(".", "_", str_replace(":", "_", server_remote_addr())) . ".jpg";
//if (file_exists($imgname)) unlink($imgname);
$iois=imagecreatetruecolor(max(max($p2,$p3),$p1), max(max($p2,$p3),$p1));
$ourp5=fmc($iois, $p4);
//$ourp5=imagecolorallocate($iois, $ris, $bis, $gis); // vs red
imagefilledrectangle($iois, 0, 0, ($p2 + 0), ($p3 + 0), $ourp5);
imagejpeg($iois, $imgname);
imagedestroy($iois);
return $imgname;
} else if ($drawwhat == "Line") {
$imgname="animage_" . str_replace(".", "_", str_replace(":", "_", server_remote_addr())) . ".jpg";
//if (file_exists($imgname)) unlink($imgname);
$iois=imagecreatetruecolor(max(max($p2,$p4),$p1), max(max($p3,$p5),$p1));
$ourp5=fmc($iois, $p6);
//$ourp5=imagecolorallocate($iois, $ris, $bis, $gis); // vs red
imageline($iois, $p2, $p3, $p4, $p5, $ourp5);
imagejpeg($iois, $imgname);
imagedestroy($iois);
return $imgname;
} else if ($drawwhat == "Ellipse") {
$imgname="animage_" . str_replace(".", "_", str_replace(":", "_", server_remote_addr())) . ".jpg";
//if (file_exists($imgname)) unlink($imgname);
$iois=imagecreatetruecolor(max($p4,$p1), max($p5,$p1));
$ourp5=fmc($iois, $p6);
//$ourp5=imagecolorallocate($iois, $ris, $bis, $gis); // vs red
imagefilledellipse($iois, $p2, $p3, $p4, $p5, $ourp5);
imagejpeg($iois, $imgname);
imagedestroy($iois);
return $imgname;
} else if ($drawwhat == "Polygon") {
//file_put_contents("ideasfrom.zzz", "1");
$imgname="animage_" . str_replace(".", "_", str_replace(":", "_", server_remote_addr())) . ".jpg";
//file_put_contents("ideasfrom.zzz", "2");
if (1 == 1) {
$iois=imagecreatetruecolor(($p1 * 2), $p1);
//file_put_contents("ideasfrom.zzz", "3");
$ourp5=fmc($iois, $p3);
//file_put_contents("ideasfrom.zzz", "4");
//eval(" $arr2=array(" . str_replace(" ", ",", urldecode($p2)) . ");");
$arr2=explode(",", str_replace(" ", ",", urldecode($p2)));
//file_put_contents("ideasfrom.zzz", "5");
imagefilledpolygon($iois, $arr2, (sizeof($arr2) / 2), $ourp5);
//file_put_contents("ideasfrom.zzz", "6");
imagejpeg($iois, $imgname);
//file_put_contents("ideasfrom.zzz", "7");
imagedestroy($iois);
//file_put_contents("ideasfrom.zzz", "8");
}
return $imgname;
}
return $imgname;
}
if ($what == "") {
?>
SVG Tutorial - RJM Programming - July, 2014 and December, 2016 ... thanks to http://www.tutorialspoint.com/html5/html5_svg.htm
HTML5 SVG Tutorial
(Optional geometry tracing game as well)
|