Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我相信 TCPDF 中没有本地方法来创建阴影。有什么想法可以用它的任何其他方法创造这样的效果吗?我首先考虑在每个边缘(用于矩形)旁边创建一个小渐变,但发现无法创建具有不同 Alpha 通道的渐变。
像这样的东西:
class MYPDF extends TCPDF { public function addShadow($x,$y,$h,$w){ for($i=5;$i>=1;$i-=0.5){ $this->SetAlpha(0.1-($i*0.02)); $this->SetFillColor(0, 0, 0); $this->SetDrawColor(0, 0, 0); $this->Rect($x+$i, $y+$i, $h, $w, 'DF'); } $this->SetAlpha(1); } }