Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
ImageWatermark.php
1
<?php
9
namespace
Bitrix\Main\File\Image
;
10
11
class
ImageWatermark
extends
Watermark
12
{
13
const
SIZE_REAL
=
"real"
;
14
15
const
16
MODE_REPEAT
=
'repeat'
,
17
MODE_EXACT
=
'exact'
,
18
MODE_RESIZE
=
'resize'
;
19
20
protected
$imageFile
;
21
protected
$mode
=
self::MODE_RESIZE
;
22
protected
$alpha
= 1.0;
23
28
public
function
__construct
(
$imageFile
=
null
)
29
{
30
parent::__construct();
31
32
$this->imageFile =
$imageFile
;
33
}
34
35
public
function
getRatio
()
36
{
37
if
($this->ratio ===
null
)
38
{
39
if
($this->size == static::SIZE_BIG)
40
{
41
return
0.75;
42
}
43
if
($this->size == static::SIZE_SMALL)
44
{
45
return
0.20;
46
}
47
if
($this->size == static::SIZE_REAL)
48
{
49
return
1.00;
50
}
51
//static::SIZE_MEDIUM
52
return
0.50;
53
}
54
return
$this->ratio
;
55
}
56
60
public
function
getMode
()
61
{
62
return
$this->mode
;
63
}
64
69
public
function
setMode
(
$mode
)
70
{
71
$this->mode =
$mode
;
72
return
$this;
73
}
74
78
public
function
getAlpha
()
79
{
80
return
$this->alpha
;
81
}
82
87
public
function
setAlpha
(
$alpha
)
88
{
89
$this->alpha = (float)
$alpha
;
90
return
$this;
91
}
92
96
public
function
getImageFile
()
97
{
98
return
$this->imageFile
;
99
}
100
105
public
function
setImageFile
(
$imageFile
)
106
{
107
$this->imageFile =
$imageFile
;
108
return
$this;
109
}
110
}
Bitrix\Main\File\Image\ImageWatermark
Definition
ImageWatermark.php:12
Bitrix\Main\File\Image\ImageWatermark\MODE_REPEAT
const MODE_REPEAT
Definition
ImageWatermark.php:16
Bitrix\Main\File\Image\ImageWatermark\MODE_EXACT
const MODE_EXACT
Definition
ImageWatermark.php:17
Bitrix\Main\File\Image\ImageWatermark\__construct
__construct($imageFile=null)
Definition
ImageWatermark.php:28
Bitrix\Main\File\Image\ImageWatermark\$mode
$mode
Definition
ImageWatermark.php:21
Bitrix\Main\File\Image\ImageWatermark\$alpha
$alpha
Definition
ImageWatermark.php:22
Bitrix\Main\File\Image\ImageWatermark\getMode
getMode()
Definition
ImageWatermark.php:60
Bitrix\Main\File\Image\ImageWatermark\SIZE_REAL
const SIZE_REAL
Definition
ImageWatermark.php:13
Bitrix\Main\File\Image\ImageWatermark\getRatio
getRatio()
Definition
ImageWatermark.php:35
Bitrix\Main\File\Image\ImageWatermark\setAlpha
setAlpha($alpha)
Definition
ImageWatermark.php:87
Bitrix\Main\File\Image\ImageWatermark\setImageFile
setImageFile($imageFile)
Definition
ImageWatermark.php:105
Bitrix\Main\File\Image\ImageWatermark\getImageFile
getImageFile()
Definition
ImageWatermark.php:96
Bitrix\Main\File\Image\ImageWatermark\$imageFile
$imageFile
Definition
ImageWatermark.php:20
Bitrix\Main\File\Image\ImageWatermark\setMode
setMode($mode)
Definition
ImageWatermark.php:69
Bitrix\Main\File\Image\ImageWatermark\MODE_RESIZE
const MODE_RESIZE
Definition
ImageWatermark.php:18
Bitrix\Main\File\Image\ImageWatermark\getAlpha
getAlpha()
Definition
ImageWatermark.php:78
Bitrix\Main\File\Image\Watermark
Definition
Watermark.php:12
Bitrix\Main\File\Image\Watermark\$ratio
$ratio
Definition
Watermark.php:30
Bitrix\Main\File\Image
Definition
Color.php:9
modules
main
lib
File
Image
ImageWatermark.php
Создано системой
1.10.0