private function drawImage($element, $canvas)
    {
        $image = $element->getResource();

        imagecopyresampled(
            $canvas,
            $image,
            $element->getLeft(),
            $element->getTop(),
            $element->getBoxLeft(),
            $element->getBoxTop(),
            $element->getBoxWidth(),
            $element->getBoxHeight(),
            $element->getWidth(),
            $element->getHeight()
        );
    }