예제 #1
0
파일: spotcolor.php 프로젝트: promoso/HVAC
function colorline($ps, $leftborder, $spot)
{
    for ($i = 1; $i <= 10; $i++) {
        PS_setcolor($ps, "fill", "spot", $spot["id"], $i * 0.1, 0.0, 0.0);
        PS_rect($ps, $leftborder, 35 + $i * 65, 50, 50);
        PS_fill($ps);
    }
    PS_setcolor($ps, "stroke", "gray", 0.0, 0.0, 0.0, 0.0);
    $psfont = PS_findfont($ps, "Helvetica", "", 0);
    PS_setfont($ps, $psfont, 7.0);
    PS_show_xy($ps, $spot["name"], $leftborder, 100 + 10 * 65 + 13);
    if (!strcmp($spot["colorspace"], "cmyk")) {
        $buffer = sprintf("%.2f, %.2f, %.2f, %.2f", $spot["c1"], $spot["c2"], $spot["c3"], $spot["c4"]);
        PS_show_xy($ps, $buffer, $leftborder, 100 + 10 * 65 + 3);
    } else {
        if (!strcmp($spot["colorspace"], "rgb")) {
            $buffer = sprintf("%.2f, %.2f, %.2f", $spot["c1"], $spot["c2"], $spot["c3"]);
            PS_show_xy($ps, $buffer, $leftborder, 100 + 10 * 65 + 3);
        }
    }
}
예제 #2
0
파일: shading.php 프로젝트: promoso/HVAC
PS_translate($ps, LEFT_BORDER + 130, 240);
$pspattern = PS_shading_pattern($ps, $shading2, NULL);
PS_setcolor($ps, "fill", "pattern", (double) $pspattern, 0.0, 0.0, 0.0);
PS_rect($ps, 0, 0, 100, 100);
PS_fill($ps);
PS_restore($ps);
PS_end_page($ps);
/* Page 4 */
PS_begin_page($ps, 596, 842);
PS_setcolor($ps, "fill", "rgb", 0, 0, 1, 0);
$shading1 = PS_shading($ps, "axial", (double) 0, 0.0, 470.0, 0.0, 1.0, 1.0, 0.0, 0.0, "N 1");
PS_setfont($ps, $antiqua, 20.0);
PS_show_xy($ps, "Using shading patterns for drawing", LEFT_BORDER, 763);
PS_setfont($ps, $antiqua, 10.0);
PS_set_value($ps, "leading", 15.0);
PS_show_boxed($ps, "A pattern is like a color and be used like one. The examples on the previous pages used the pattern for filling rectangles. Why not use it for something more fancy like filling the outline of a text or drawing with a pattern.", LEFT_BORDER, 170, 360, 580, "left", NULL);
PS_save($ps);
PS_translate($ps, LEFT_BORDER, 620);
$pspattern = PS_shading_pattern($ps, $shading1, NULL);
PS_setcolor($ps, "stroke", "pattern", (double) $pspattern, 0.0, 0.0, 0.0);
PS_setfont($ps, $antiqua, 90.0);
PS_show_xy($ps, "Some text.", 0, 10);
PS_setlinewidth($ps, 5);
PS_moveto($ps, 0, 0);
PS_lineto($ps, 470, 0);
PS_stroke($ps);
PS_restore($ps);
PS_end_page($ps);
PS_close($ps);
PS_delete($ps);
exit(0);