SVG - 图像周围的矩形

时间:2012-09-17 16:24:47

标签: php svg

我是SVG的新手,我需要解决一些问题。

我有一个php for循环,它会生成一个圆圈,图像的正下方有图像。每个图像周围都有一个矩形。围绕圆圈生成rects。

我需要将图像置于矩形内部并显示名称,因为现在它们已插入但不可见。

for($i=0;$i<$count;$i++) {
    $x = ($x_inicial+($raio*cos(deg2rad($teta)))) ;
    $y = ($y_inicial+($raio*sin(deg2rad($teta)))) ;
    $string .= '<line x1="'.($x_inicial+($tam/2)).'" y1="'.($y_inicial+($tam/2)).'" x2="'.($x+($tam/2)).'" y2="'.($y+($tam/2)).'"  style="stroke:#045f89;stroke-width:3"/>
           <a xlink:href="'.URL.'empresa/perfil/'.$empresas[$i]['slug'].'" >
           <rect width="'.($tam*1.4).'px"  height="'.($tam*1.4).'px" x="'.$x.'" y="'.$y.'" style="stroke:gray;stroke-width:1;fill-opacity:0;stroke-opacity:1"/>
           <image nome="'.$empresas[$i]['nome'].'" x="'.$x.'" y="'.$y.'" width="'.$tam.'px" height="'.$tam.'px" xlink:href="'.URL.$empresas[$i]['foto'].'_thumb'.$empresas[$i]['extensao'].'" class="redondo" />
            '.$empresas[$i]['nome'].'</a>';
    $teta = $teta + $razao;
}

0 个答案:

没有答案