Imbo\Image\Transformation\Border::drawBorderInside PHP Method

drawBorderInside() private method

Draw border inside (on top of) the existing image
private drawBorderInside ( string $color, integer $borderWidth, integer $borderHeight, Image $image )
$color string
$borderWidth integer
$borderHeight integer
$image Imbo\Model\Image
    private function drawBorderInside($color, $borderWidth, $borderHeight, Image $image)
    {
        $imageWidth = $image->getWidth();
        $imageHeight = $image->getHeight();
        $rect = new ImagickDraw();
        $rect->setStrokeColor($color);
        $rect->setFillColor($color);
        $rect->setStrokeAntialias(false);
        // Left
        $rect->rectangle(0, 0, $borderWidth - 1, $imageHeight);
        // Right
        $rect->rectangle($imageWidth - $borderWidth, 0, $imageWidth, $imageHeight);
        // Top
        $rect->rectangle(0, 0, $imageWidth, $borderHeight - 1);
        // Bottom
        $rect->rectangle(0, $imageHeight - $borderHeight, $imageWidth, $imageHeight);
        // Draw the border
        $this->imagick->drawImage($rect);
    }