PHP code example of lbigroupp / dpegenerator

1. Go to this page and download the library: Download lbigroupp/dpegenerator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lbigroupp / dpegenerator example snippets

 
(boolean) setGenerateImage 
 
(string) setPathToWriteImage 
 
(string) setNameOfPicture 
 
(string) setPictureType 
 
(int) setDpeVal 
 
(int) setGesVal 

(int) setSuperficie 
 
const DPE_TYPE;
 
const GES_TYPE;

$type = \LBIGroupDpeGenerator\DpeGenerator::DPE_TYPE; 
// OR $type = \LBIGroupDpeGenerator\DpeGenerator::GES_TYPE
$dpeVal = 29;
$gesVal = 2;
$superficie = 35;
$imgTarget = "YOUR_TARGET";
$pictureName = "YOUR_PICTURE_NAME";

if (file_exists($imgTarget . $pictureName . '.png')) {
    return $imgTarget . $pictureName . '.png';
}

$dpe = new \LBIGroupDpeGenerator\DpeGenerator();
$dpe->setDpeVal($dpeVal);
$dpe->setGesVal($gesVal);
$dpe->setSuperficie($superficie);
$dpe->setPictureType($type);
$dpe->setPathToWriteImage($imgTarget);
$dpe->setNameOfPicture($pictureName);
$dpe->setGenerateImage(true);

// return file location
echo $dpe->generatePicture();

$type = \LBIGroupDpeGenerator\DpeGenerator::DPE_TYPE; 
// OR $type = \LBIGroupDpeGenerator\DpeGenerator::GES_TYPE
$dpeVal = 29;
$gesVal = 2;
$superficie = 35;

$dpe = new \LBIGroupDpeGenerator\DpeGenerator();
$dpe->setDpeVal($dpeVal);
$dpe->setGesVal($gesVal);
$dpe->setSuoerficie($superficie);
$dpe->setPictureType($type);

// return file location
echo $dpe->generatePicture();