本文整理匯總了PHP中stdClass::Image方法的典型用法代碼示例。如果您正苦於以下問題:PHP stdClass::Image方法的具體用法?PHP stdClass::Image怎麽用?PHP stdClass::Image使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類stdClass
的用法示例。
在下文中一共展示了stdClass::Image方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: print_signature
/**
* Prints signature images or a line.
*
* @param stdClass $pdf
* @param stdClass $certificate
* @param int $x x position
* @param int $y y position
* @param int $w the width
* @param int $h the height
* @return null
*/
function print_signature($pdf, $certificate, $x, $y, $w, $h)
{
global $CFG, $DB;
switch ($certificate->printsignature) {
case '0':
case '':
break;
default:
if (file_exists("{$CFG->dirroot}/mod/certificate/pix/signatures/{$certificate->printsignature}")) {
$pdf->Image("{$CFG->dirroot}/mod/certificate/pix/signatures/{$certificate->printsignature}", $x, $y, $w, $h);
}
break;
}
}
示例2: certificate_print_image
/**
* Prints border images from the borders folder in PNG or JPG formats.
*
* @param stdClass $pdf
* @param stdClass $certificate
* @param string $type the type of image
* @param int $x x position
* @param int $y y position
* @param int $w the width
* @param int $h the height
*/
function certificate_print_image($pdf, $certificate, $type, $x, $y, $w, $h)
{
global $CFG;
switch ($type) {
case CERT_IMAGE_BORDER:
$attr = 'borderstyle';
$path = "{$CFG->dirroot}/mod/certificate/pix/{$type}/{$certificate->borderstyle}";
$uploadpath = "{$CFG->dataroot}/mod/certificate/pix/{$type}/{$certificate->borderstyle}";
break;
case CERT_IMAGE_SEAL:
$attr = 'printseal';
$path = "{$CFG->dirroot}/mod/certificate/pix/{$type}/{$certificate->printseal}";
$uploadpath = "{$CFG->dataroot}/mod/certificate/pix/{$type}/{$certificate->printseal}";
break;
case CERT_IMAGE_SIGNATURE:
$attr = 'printsignature';
$path = "{$CFG->dirroot}/mod/certificate/pix/{$type}/{$certificate->printsignature}";
$uploadpath = "{$CFG->dataroot}/mod/certificate/pix/{$type}/{$certificate->printsignature}";
break;
case CERT_IMAGE_WATERMARK:
$attr = 'printwmark';
$path = "{$CFG->dirroot}/mod/certificate/pix/{$type}/{$certificate->printwmark}";
$uploadpath = "{$CFG->dataroot}/mod/certificate/pix/{$type}/{$certificate->printwmark}";
break;
}
// Has to be valid
if (!empty($path)) {
switch ($certificate->{$attr}) {
case '0':
case '':
break;
default:
if (file_exists($path)) {
$pdf->Image($path, $x, $y, $w, $h);
}
if (file_exists($uploadpath)) {
$pdf->Image($uploadpath, $x, $y, $w, $h);
}
break;
}
}
}