Location: PHPKode > projects > PHP Cad and Drawing Program > functions/tobicon.inc
AAAAAAAAAAAAAAAAAAAAAAAAA
// this is powerful, to use .tobs as objects (use phpcad pictures to make pictures)
// dont let $tob=$image or your system will run out of memory - infinity
// $tob is the .tob you want to paste
// $iconscale to $imagescale is a ratio.
function tobicon($image,$tob,$iconscale,$imagescale,$scale,$x,$y) {

    $scalebak=$scale;
    $ff = str_replace(".tob",".setup",$tob);
    if (file_exists("./files/$ff")) {
        include("./files/$ff");
    } else {
        include("./files/picture.setup");
    }
    $imagebak=$image;
    $scale = $iconscale/$imagescale*$scalebak;
    $image = ImageCreate($a*$scale,$b*$scale);
    $padobeorange=ImageColorAllocate($image,150,91,14);
    include ("./files/$tob");
    if ($imageformat=="png") Header("Content-type: image/png");
    if (!$imageformat) Header("Content-type: image/png");
    if ($imageformat=="jpg" AND $time=="") Header("Content-type: image/jpeg");
    $w = ImageSX($image);
    $h = ImageSY($image);
    $icon=$image;
    $image=$imagebak;
    ImageCopy($image,$icon,$x*$scalebak,$y*$scalebak, 0, 0, $w, $h);
}
BBBBBBBBBBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCCCCCCCCCCC
function tobicon($image,$tob,$iconscale,$imagescale,$scale,$x,$y) {
include("./files/$tob");
}
DDDDDDDDDDDDDDDDDDDDDDDD
$inthemenu = "no";
$dirlist= array("NA");
$lenlist= array("NA");
$txtitem="AAAAAA";
EEEEEEEEEEEEEEEEEEEEEEEEEEEEE
Return current item: PHP Cad and Drawing Program