Location: PHPKode > projects > PHP Cad and Drawing Program > phpcad/functions/pixelone.inc
AAAAAAAAAAAAAAAAAAAAAA To draw on screen
//
//  Draws a simple pixel, click point and submit.
//  Color option may be added later.
//  The pixel is only 1 unit high in povray though
//
function pixelone($image, $scale, $x, $y)
{
    $edge = ImageColorAllocate($image,110,190,190);
    $padobe = ImageColorAllocate($image,100,180,180);
    $x = $x * $scale;
    $y = $y * $scale;
    ImageFilledRectangle($image,$x,$y,$x+$scale,$y+$scale,$padobe);
    ImageRectangle($image,$x,$y,$x+$scale,$y+$scale,$edge);
}
BBBBBBBBBBBBBBBBBBBBBBB Scriptmaker
if ($PObj == "pixelone") {
    $a=fopen("./files/$pfilez", "a");
    for($i = 0;$i < $PLen; ++$i) {
        if ($PDir == "R") {
            $xp = "<?php " . $PObj . "($" . "image,";
            $xp .= "$" . "scale," . $xx . "," . $yy . "); ?>\n";
            $xx++;
        } else {
            $xp = "<?php " . $PObj . "($" . "image,";
            $xp .= "$" . "scale," . $xx . "," . $yy . "); ?>\n";
            $yy++;
        }
        fwrite($a, $xp);
    }
    fclose($a);
}
CCCCCCCCCCCCCCCCCCCCCCCCCCCC Povray
function pixelone($image,$scale,$x,$y)
{
global $floor;
global $twall;
global $tfoundation;
global $zz;
$a = "box{<";
$a .= $x . "," . ($floor) . ",";
$a .= $y  . "><";
$a .= $x+1;
$a .= "," . (1+$floor) . ",";
$a .= $y+1;
$a .= "> $twall}\n";
fwrite($zz,$a);
}
DDDDDDDDDDDDDDDDDDDDDDDDDDDDD
$inthemenu = "yes";
$dirlist = array("R","D");
$lenlist = array("1","2","3","4","5","6","7","8","10","12","16","20","25","30");
$txtitem="";
EEEEEEEEEEEEEEEEEEEEEEEEEEEEE
Return current item: PHP Cad and Drawing Program