update : 2015.11.03
php.shukuma.com

검색:
 
 
Sets the overall canvas size

ImagickDraw::setViewbox

(PECL imagick 2.0.0)

ImagickDraw::setViewboxSets the overall canvas size

설명

bool ImagickDraw::setViewbox ( int $x1 , int $y1 , int $x2 , int $y2 )
Warning

이 함수는 현재 문서화 되어있지 않습니다; 인수 목록만을 제공합니다.

Sets the overall canvas size to be recorded with the drawing vector data. Usually this will be specified using the same size as the canvas image. When the vector data is saved to SVG or MVG formats, the viewbox is use to specify the size of the canvas image that a viewer will render the vector data on.

인수

x1

left x coordinate

y1

left y coordinate

x2

right x coordinate

y2

right y coordinate

반환값

값을 반환하지 않습니다.

예제

Example #1 ImagickDraw::setViewBox()

<?php
function setViewBox($strokeColor$fillColor$backgroundColor) {

    
$draw = new \ImagickDraw();

    
$draw->setStrokeColor($strokeColor);
    
$draw->setFillColor($fillColor);
    
$draw->setStrokeWidth(2);
    
$draw->setFontSize(72);

    
/*
     
    Sets the overall canvas size to be recorded with the drawing vector data. Usually this will be specified using the same size as the canvas image. When the vector data is saved to SVG or MVG formats, the viewbox is use to specify the size of the canvas image that a viewer will render the vector data on.
    
     */

    
$draw->circle(2502502500);
    
$draw->setviewbox(00200200);
    
$draw->circle(125250250250);
    
$draw->translate(250125);
    
$draw->circle(001250);


    
$imagick = new \Imagick();
    
$imagick->newImage(500500$backgroundColor);
    
$imagick->setImageFormat("png");

    
$imagick->drawImage($draw);

    
header("Content-Type: image/png");
    echo 
$imagick->getImageBlob();
}

?>