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
(mixed $left, mixed $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, [mixed &$format =
NULL ])
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 Image |
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 61 |
int | ENLARGE |
1 |
line 47 resize() allows enlarging image (it only shrinks images by default) |
int | FILL |
4 |
line 53 resize() fills (and even overflows) given area |
string | GIF |
IMAGETYPE_GIF |
line 58 |
string | JPEG |
IMAGETYPE_JPEG |
line 56 |
string | PNG |
IMAGETYPE_PNG |
line 57 |
int | STRETCH |
2 |
line 50 resize() will ignore aspect ratio |
Variable Summary | ||||
---|---|---|---|---|
static bool | $useImageMagick | FALSE |
line 64 |
Method Details | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line 193 __constructpublic Image __construct (resource $image) Wraps GD image. Overridden in child classes as:
|
|||||||||||||||||||||
line 274 calculateSizepublic array calculateSize (mixed $newWidth, mixed $newHeight, [int $flags = Calculates dimensions of resized image.
|
|||||||||||||||||||||
line 344 croppublic Image crop (mixed $left, mixed $top, int $width, int $height) Crops image. Overridden in child classes as:
|
|||||||||||||||||||||
line 164 fromBlankpublic static Image fromBlank (int $width, int $height, [array $color = Creates blank image.
|
|||||||||||||||||||||
line 97 fromFilepublic static Image fromFile (string $file, [mixed &$format = Opens image from file.
|
|||||||||||||||||||||
line 134 fromStringpublic static Image fromString (string $s, [mixed &$format = Create a new image from the image stream in the string.
|
|||||||||||||||||||||
line 215 getHeightpublic int getHeight () Returns image height. Overridden in child classes as:
|
|||||||||||||||||||||
line 242 getImageResourcepublic resource getImageResource () Returns image GD resource. Overridden in child classes as:
|
|||||||||||||||||||||
line 204 getWidthpublic int getWidth () Returns image width. Overridden in child classes as:
|
|||||||||||||||||||||
line 391 placepublic Image place (Image $image, [mixed $left = Puts another image into this image.
|
|||||||||||||||||||||
line 256 resizepublic Image resize (mixed $newWidth, mixed $newHeight, [int $flags = Resizes image. Overridden in child classes as:
|
|||||||||||||||||||||
line 79 rgbpublic static array rgb (int $red, int $green, int $blue, [int $transparency = Returns RGB color.
|
|||||||||||||||||||||
line 421 savepublic bool save ([string $file = Saves image to the file. Overridden in child classes as:
|
|||||||||||||||||||||
line 494 sendpublic bool send ([int $type = Outputs image to browser.
|
|||||||||||||||||||||
line 227 setImageResourceprotected Image setImageResource (resource $image) Sets image resource.
|
|||||||||||||||||||||
line 371 sharpenpublic Image sharpen () Sharpen image.
|
|||||||||||||||||||||
line 462 toStringpublic string toString ([int $type = Outputs image to string.
|
|||||||||||||||||||||
line 513 __callpublic mixed __call (string $name, array $args) Call to undefined method.
|
|||||||||||||||||||||
line 475 __toStringpublic string __toString () Outputs image to string.
|