PHPRtfLite_Image::create PHP Méthode

create() private static méthode

factory method creates rtf image from stream
private static create ( PHPRtfLite $rtf, resource $stream, string $type, float $width, float $height ) : PHPRtfLite_Image_Wmf | PHPRtfLite_Image_Gd | PHPRtfLite_Image
$rtf PHPRtfLite
$stream resource
$type string (represented by class constants)
$width float optional
$height float optional
Résultat PHPRtfLite_Image_Wmf | PHPRtfLite_Image_Gd | PHPRtfLite_Image
    private static function create(PHPRtfLite $rtf, $stream, $type, $width, $height)
    {
        switch ($type) {
            case self::TYPE_WMF:
                return new PHPRtfLite_Image_Wmf($rtf, $stream, $width, $height);
            default:
                $image = new PHPRtfLite_Image_Gd($rtf, $stream, $width, $height);
                $image->setImageType($type);
                return $image;
        }
    }