Ejemplo n.º 1
0
 static function mark($picture, $mark = array('http://www.eqphp.com', '艺青科技'), $filename = array('test.png', 'file/create/'))
 {
     $image = img::open($picture);
     $img_width = img::info($image, 'width');
     $img_height = img::info($image, 'height');
     $text_color = img::color($image, 'fefefe');
     $alpha = imagecolorallocatealpha($image, 15, 15, 15, 85);
     $border_color = img::color($image, 'efefef');
     img::draw($image, $border_color, array(0, 0, $img_width - 1, $img_height - 1), 'rectangle');
     img::fill($image, $alpha, array(1, $img_height - 35, $img_width - 2, $img_height - 2), 'rectangle');
     imagettftext($image, 9, 0, $img_width - 145, $img_height - 14, $text_color, dc_data_static . 'font/lucon.ttf', $mark[0]);
     imagettftext($image, 9, 0, $img_width - 210, $img_height - 15, $text_color, dc_data_static . 'font/msyh.ttf', $mark[1]);
     return img::save($image, $filename[0], $filename[1]);
 }
Ejemplo n.º 2
0
 static function mark($img, $mark_info = array('http://www.eq80.com', '艺青科技'), $save_param = array('eq80_test.png', 'file/create/'))
 {
     $res = img::open($img);
     $img_width = img::info($res, 'width');
     $img_height = img::info($res, 'height');
     $text_color = img::color($res, 'fefefe');
     $alpha = imagecolorallocatealpha($res, 15, 15, 15, 85);
     $border_color = img::color($res, 'efefef');
     img::draw($res, $border_color, array(0, 0, $img_width - 1, $img_height - 1), 'rectangle');
     img::fill($res, $alpha, array(1, $img_height - 35, $img_width - 2, $img_height - 2), 'rectangle');
     imagettftext($res, 9, 0, $img_width - 145, $img_height - 14, $text_color, dc_data_static . 'font/lucon.ttf', $mark_info[0]);
     imagettftext($res, 9, 0, $img_width - 210, $img_height - 15, $text_color, dc_data_static . 'font/msyh.ttf', $mark_info[1]);
     return img::save($res, $save_param[0], $save_param[1]);
 }