Movatterモバイル変換


[0]ホーム

URL:


mPDF Manual – mPDF functions

SetAlpha()

(mPDF ≥ 1.0)

SetAlpha – Set the opacity for Images

Description

voidSetAlpha ( float$alpha [, string$blend ])

Set the opacity and blend mode for Images

Parameters

$alpha

This parameter specifies the opacity for any subsequent images written to the current document.

Values

Float:0 (transparent) to1 (opaque)

$blend

This parameter specifies the blend mode.

Values

One of the following strings:

  • 'Normal'
  • 'Multiply'
  • 'Screen'
  • 'Overlay'
  • 'Darken'
  • 'Lighten'
  • 'ColorDodge'
  • 'ColorBurn'
  • 'HardLight'
  • 'SoftLight'
  • 'Difference'
  • 'Exclusion'
  • 'Hue'
  • 'Saturation'
  • 'Color'
  • 'Luminosity'

Default:'Normal'

Changelog

VersionDescription
1.0Function was added.

Examples

Example #1

<?php// Require composer autoloadrequire_once__DIR__.'/vendor/autoload.php';$mpdf=new\Mpdf\Mpdf();$mpdf->SetAlpha(0.5);$mpdf->WriteHTML('<img src="clematis.jpg" />');$mpdf->SetAlpha(1);// This produces the identical result as the last 3 lines// $mpdf->WriteHTML('<img src="clematis.jpg" opacity="0.5" />');$mpdf->Output();exit;

See Also

  • Image() - Write an image to the current document

[8]ページ先頭

©2009-2026 Movatter.jp