mirror of
https://github.com/Chouchen/svgToImage.git
synced 2020-02-03 22:08:42 +01:00
Ajout de stroke + fill |
Ajout de nouveaux Path possible
This commit is contained in:
parent
99193a4aaf
commit
4e963e7ce3
@ -421,11 +421,10 @@ class SVGTOIMAGE{
|
|||||||
$pathArray = split('[ ,]', $path);
|
$pathArray = split('[ ,]', $path);
|
||||||
|
|
||||||
// Si le path est de format 'm 100 100 l 100 100 z' il faut recoller les morceaux
|
// Si le path est de format 'm 100 100 l 100 100 z' il faut recoller les morceaux
|
||||||
if(array_key_exists($pathArray[0], $this->pathType)){
|
if(array_key_exists(strtolower($pathArray[0]), $this->pathType)){
|
||||||
reset($pathArray);
|
|
||||||
$j = 0;
|
$j = 0;
|
||||||
do{
|
do{
|
||||||
if(array_key_exists($pathArray[$j], $this->pathType)){
|
if(array_key_exists(strtolower($pathArray[$j]), $this->pathType)){
|
||||||
$pathArray[$j] = $pathArray[$j].$pathArray[$j+1];
|
$pathArray[$j] = $pathArray[$j].$pathArray[$j+1];
|
||||||
$pathArray[$j+1] = '~';
|
$pathArray[$j+1] = '~';
|
||||||
$j++;
|
$j++;
|
||||||
@ -549,12 +548,12 @@ class SVGTOIMAGE{
|
|||||||
$colorStroke = $this->_allocateColor((string)$stroke);
|
$colorStroke = $this->_allocateColor((string)$stroke);
|
||||||
$colorFill = $this->_allocateColor((string)$fill);
|
$colorFill = $this->_allocateColor((string)$fill);
|
||||||
|
|
||||||
if($fill == ''){
|
if($fill != ''){
|
||||||
imagearc($this->_image , $x , $y , $r*2 , $r*2,0,359.9, $colorStroke );
|
|
||||||
//imageellipse ($this->_image , $x , $y , $r*2 , $r*2, $colorStroke );
|
|
||||||
}else{
|
|
||||||
|
|
||||||
imagefilledarc($this->_image , $x , $y , $r*2 , $r*2 ,0,359.9, $colorFill, IMG_ARC_PIE );
|
imagefilledarc($this->_image , $x , $y , $r*2 , $r*2 ,0,359.9, $colorFill, IMG_ARC_PIE );
|
||||||
|
//imageellipse ($this->_image , $x , $y , $r*2 , $r*2, $colorStroke );
|
||||||
|
}
|
||||||
|
if($stroke !=''){
|
||||||
|
imagearc($this->_image , $x , $y , $r*2 , $r*2,0,359.9, $colorStroke );
|
||||||
}
|
}
|
||||||
imagecolordeallocate( $this->_image, $colorStroke);
|
imagecolordeallocate( $this->_image, $colorStroke);
|
||||||
imagecolordeallocate( $this->_image, $colorFill);
|
imagecolordeallocate( $this->_image, $colorFill);
|
||||||
@ -641,11 +640,12 @@ class SVGTOIMAGE{
|
|||||||
|
|
||||||
if($this->_debug && !$thickness) $this->_log->error('Erreur dans la mise en place de l\'épaisseur du trait');
|
if($this->_debug && !$thickness) $this->_log->error('Erreur dans la mise en place de l\'épaisseur du trait');
|
||||||
if($this->_debug) $this->_log->message('Rectangle - x : '.$x.' - y : '.$y.' - width : '.$width.' - height : '.$height.' - fill : '.$colorFill[0].'-'.$colorFill[1].'-'.$colorFill[2].' - stroke : '.$colorStroke[0].'-'.$colorStroke[1].'-'.$colorStroke[2]);
|
if($this->_debug) $this->_log->message('Rectangle - x : '.$x.' - y : '.$y.' - width : '.$width.' - height : '.$height.' - fill : '.$colorFill[0].'-'.$colorFill[1].'-'.$colorFill[2].' - stroke : '.$colorStroke[0].'-'.$colorStroke[1].'-'.$colorStroke[2]);
|
||||||
if($fill == ''){
|
if($fill != ''){
|
||||||
imagerectangle($this->_image , $x , $y , $x+$width , $y+$height, IMG_COLOR_STYLED);
|
|
||||||
}else{
|
|
||||||
imagefilledrectangle ($this->_image , $x , $y , $x+$width , $y+$height, $colorFill );
|
imagefilledrectangle ($this->_image , $x , $y , $x+$width , $y+$height, $colorFill );
|
||||||
}
|
}
|
||||||
|
if($stroke != ''){
|
||||||
|
imagerectangle($this->_image , $x , $y , $x+$width , $y+$height, IMG_COLOR_STYLED);
|
||||||
|
}
|
||||||
imagecolordeallocate($this->_image,$colorStroke);
|
imagecolordeallocate($this->_image,$colorStroke);
|
||||||
imagecolordeallocate($this->_image,$colorFill);
|
imagecolordeallocate($this->_image,$colorFill);
|
||||||
imagesetthickness ( $this->_image , 1 );
|
imagesetthickness ( $this->_image , 1 );
|
||||||
@ -680,11 +680,12 @@ class SVGTOIMAGE{
|
|||||||
$thickness = imagesetthickness( $this->_image , (int)$strokeWidth );
|
$thickness = imagesetthickness( $this->_image , (int)$strokeWidth );
|
||||||
if($this->_debug && !$thickness) $this->_log->error('Erreur dans la mise en place de l\'épaisseur du trait');
|
if($this->_debug && !$thickness) $this->_log->error('Erreur dans la mise en place de l\'épaisseur du trait');
|
||||||
|
|
||||||
if($fill == ''){
|
if($fill != ''){
|
||||||
imagepolygon ( $this->_image , $pointArray , count($pointArray)/2 , $colorStroke );
|
|
||||||
}else{
|
|
||||||
imagefilledpolygon ($this->_image , $pointArray , count($pointArray)/2 , $colorFill );
|
imagefilledpolygon ($this->_image , $pointArray , count($pointArray)/2 , $colorFill );
|
||||||
}
|
}
|
||||||
|
if($stroke != ''){
|
||||||
|
imagepolygon ( $this->_image , $pointArray , count($pointArray)/2 , $colorStroke );
|
||||||
|
}
|
||||||
imagecolordeallocate($this->_image,$colorStroke);
|
imagecolordeallocate($this->_image,$colorStroke);
|
||||||
imagecolordeallocate($this->_image,$colorFill);
|
imagecolordeallocate($this->_image,$colorFill);
|
||||||
imagesetthickness ( $this->_image , 1 );
|
imagesetthickness ( $this->_image , 1 );
|
||||||
|
Loading…
Reference in New Issue
Block a user