예제 #1
0
 /**
  * 
  * 文字水印
  * @param unknown_type $data
  */
 public function addWaterText($data)
 {
     $draw = new ImagickDraw();
     $this->ImagickPixel = new ImagickPixel();
     $draw->clear();
     $draw->setfont($data['font']);
     $draw->setfontsize($data['size']);
     $this->ImagickPixel->setcolor($data['color']);
     $draw->setfillcolor($data['color']);
     $draw->setfillalpha($data['alpha']);
     $draw->settextalignment(imagick::GRAVITY_NORTHWEST);
     //左对齐
     $draw->annotation($data['pos_x'], $data['pos_y'], $data['literal']);
     $this->srcImg_source->drawimage($draw);
     $draw->destroy();
     return $this->srcImg_source;
 }