Example #1
0
 function begin_example_box($p, $llx, $lly, $title, $font)
 {
     ps_save($p);
     ps_translate($p, $llx, $lly);
     ps_setcolor($p, "fill", "gray", 0.5, 0.0, 0.0, 0.0);
     ps_rect($p, 0, EXAMPLE_BOX_HEIGHT - EXAMPLE_BOX_TITLE_HEIGHT, EXAMPLE_BOX_WIDTH, EXAMPLE_BOX_TITLE_HEIGHT);
     ps_fill($p);
     ps_setcolor($p, "stroke", "gray", 1.0, 0.0, 0.0, 0.0);
     ps_setfont($p, $font, 12.0);
     ps_show_xy($p, $title, 10, EXAMPLE_BOX_HEIGHT - EXAMPLE_BOX_TITLE_HEIGHT + 5);
     ps_setlinewidth($p, 1.0);
     ps_setcolor($p, "stroke", "gray", 0.0, 0.0, 0.0, 0.0);
     ps_rect($p, 0, 0, EXAMPLE_BOX_WIDTH, EXAMPLE_BOX_HEIGHT);
     ps_stroke($p);
     ps_moveto($p, 0, EXAMPLE_BOX_HEIGHT - EXAMPLE_BOX_TITLE_HEIGHT);
     ps_lineto($p, EXAMPLE_BOX_WIDTH, EXAMPLE_BOX_HEIGHT - EXAMPLE_BOX_TITLE_HEIGHT);
     ps_stroke($p);
 }
Example #2
0
    ps_closepath($ps);
    ps_fill($ps);
    ps_restore($ps);
    /* draw minute hand */
    ps_save($ps);
    ps_rotate($ps, -($ltime['seconds'] / 60.0 + $ltime['minutes'] - 15.0) * 6.0);
    ps_moveto($ps, -$radius / 10, -$radius / 20);
    ps_lineto($ps, $radius * 0.8, 0.0);
    ps_lineto($ps, -$radius / 10, $radius / 20);
    ps_closepath($ps);
    ps_fill($ps);
    ps_restore($ps);
    /* draw second hand */
    //    ps_setrgbcolor($ps, 1.0, 0.0, 0.0);
    ps_setlinewidth($ps, 2);
    ps_save($ps);
    ps_rotate($ps, -(($ltime['seconds'] - 15.0) * 6.0));
    ps_moveto($ps, -$radius / 5, 0.0);
    ps_lineto($ps, $radius, 0.0);
    ps_stroke($ps);
    ps_restore($ps);
    /* draw little circle at center */
    ps_circle($ps, 0, 0, $radius / 30);
    ps_fill($ps);
    ps_end_page($ps);
    # to see some difference
    //	sleep(1);
}
/*$buf = ps_get_buffer($ps);
$len = strlen($buf);