Class Image (namespace Nette)
Basic manipulation with images.
Object | --Image
Direct Known Sub-classes:
Public Method Summary | |
---|---|
Image |
__construct
(resource $image)
Wraps GD image.
|
array |
calculateSize
(mixed $newWidth, mixed $newHeight, [int $flags =
0 ])
Calculates dimensions of resized image.
|
Image |
crop
(int $left, int $top, int $width, int $height)
Crops image.
|
static Image |
fromBlank
(int $width, int $height, [array $color =
NULL ])
Creates blank image.
|
static Image |
fromFile
(string $file, [mixed &$format =
NULL ])
Opens image from file.
|
static Image |
fromString
(string $s)
Create a new image from the image stream in the string.
|
int |
getHeight
()
Returns image height.
|
resource |
Returns image GD resource.
|
int |
getWidth
()
Returns image width.
|
Image |
Puts another image into this image.
|
Image |
resize
(mixed $newWidth, mixed $newHeight, [int $flags =
0 ])
Resizes image.
|
static array |
rgb
(int $red, int $green, int $blue, [int $transparency =
0 ])
Returns RGB color.
|
bool |
Saves image to the file.
|
bool |
Outputs image to browser.
|
Image |
sharpen
()
Sharpen image.
|
string |
Outputs image to string.
|
mixed |
__call
(string $name, array $args)
Call to undefined method.
|
string |
__toString
()
Outputs image to string.
|
Protected Method Summary | |
---|---|
protected void |
setImageResource
(resource $image)
Sets image resource.
|
Methods Inherited From Object |
---|
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset() |
Constant Summary | |||
---|---|---|---|
string | EMPTY_GIF |
... |
line 57 |
int | ENLARGE |
1 |
line 47 resizing flags resize() |
string | GIF |
IMAGETYPE_GIF |
line 54 |
string | JPEG |
IMAGETYPE_JPEG |
line 52 |
string | PNG |
IMAGETYPE_PNG |
line 53 |
int | STRETCH |
2 |
line 48 resizing flags resize() |
Variable Summary | ||||
---|---|---|---|---|
static bool | $useImageMagick | FALSE |
line 60 |
Method Details | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line 169 __constructpublic Image __construct (resource $image) Wraps GD image. Overridden in child classes as:
|
|||||||||||||||||||||
line 249 calculateSizepublic array calculateSize (mixed $newWidth, mixed $newHeight, [int $flags = Calculates dimensions of resized image.
|
|||||||||||||||||||||
line 315 croppublic Image crop (int $left, int $top, int $width, int $height) Crops image. Overridden in child classes as:
|
|||||||||||||||||||||
line 143 fromBlankpublic static Image fromBlank (int $width, int $height, [array $color = Creates blank image.
|
|||||||||||||||||||||
line 93 fromFilepublic static Image fromFile (string $file, [mixed &$format = Opens image from file.
|
|||||||||||||||||||||
line 129 fromStringpublic static Image fromString (string $s) Create a new image from the image stream in the string.
|
|||||||||||||||||||||
line 191 getHeightpublic int getHeight () Returns image height. Overridden in child classes as:
|
|||||||||||||||||||||
line 217 getImageResourcepublic resource getImageResource () Returns image GD resource. Overridden in child classes as:
|
|||||||||||||||||||||
line 180 getWidthpublic int getWidth () Returns image width. Overridden in child classes as:
|
|||||||||||||||||||||
line 354 placepublic Image place (Image $image, [mixed $left = Puts another image into this image.
|
|||||||||||||||||||||
line 231 resizepublic Image resize (mixed $newWidth, mixed $newHeight, [int $flags = Resizes image. Overridden in child classes as:
|
|||||||||||||||||||||
line 75 rgbpublic static array rgb (int $red, int $green, int $blue, [int $transparency = Returns RGB color.
|
|||||||||||||||||||||
line 384 savepublic bool save ([string $file = Saves image to the file. Overridden in child classes as:
|
|||||||||||||||||||||
line 457 sendpublic bool send ([int $type = Outputs image to browser.
|
|||||||||||||||||||||
line 203 setImageResourceprotected void setImageResource (resource $image) Sets image resource.
|
|||||||||||||||||||||
line 334 sharpenpublic Image sharpen () Sharpen image.
|
|||||||||||||||||||||
line 425 toStringpublic string toString ([int $type = Outputs image to string.
|
|||||||||||||||||||||
line 476 __callpublic mixed __call (string $name, array $args) Call to undefined method.
|
|||||||||||||||||||||
line 438 __toStringpublic string __toString () Outputs image to string.
|