mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-03-29 10:08:40 +00:00
Add save to file method
This commit is contained in:
parent
220ea81f3e
commit
73d2780d48
|
|
@ -227,6 +227,40 @@ abstract class C128Abstract
|
|||
return $this->createImage($codeString, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save to file
|
||||
*
|
||||
* @param string $file File path/name
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function saveToPngFile(string $file) /* : void */
|
||||
{
|
||||
$res = $this->get();
|
||||
|
||||
imagepng($res, $file);
|
||||
imagedestroy($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save to file
|
||||
*
|
||||
* @param string $file File path/name
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function saveToJpgFile(string $file) /* : void */
|
||||
{
|
||||
$res = $this->get();
|
||||
|
||||
imagejpeg($res, $file);
|
||||
imagedestroy($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate weighted code string
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user