Class NImage (namespace Nette)
Basic manipulation with images.
NObject | --NImage
Direct Known Sub-classes:
Public Method Summary | |
---|---|
NImage |
__construct
(resource $image)
Wraps GD image.
|
array |
calculateSize
(mixed $newWidth, mixed $newHeight, [int $flags =
0 ])
Calculates dimensions of resized image.
|
NImage |
crop
(int $left, int $top, int $width, int $height)
Crops image.
|
static NImage |
fromBlank
(int $width, int $height, [array $color =
NULL ])
Creates blank image.
|
static NImage |
fromFile
(string $file, [mixed &$format =
NULL ])
Opens image from file.
|
static NImage |
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.
|
NImage |
Puts another image into this image.
|
NImage |
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.
|
NImage |
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 NImage |
setImageResource
(resource $image)
Sets image resource.
|
Methods Inherited From NObject |
---|
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 185 __constructpublic NImage __construct (resource $image) Wraps GD image. Overridden in child classes as:
|
|||||||||||||||||||||
line 266 calculateSizepublic array calculateSize (mixed $newWidth, mixed $newHeight, [int $flags = Calculates dimensions of resized image.
|
|||||||||||||||||||||
line 332 croppublic NImage crop (int $left, int $top, int $width, int $height) Crops image. Overridden in child classes as:
|
|||||||||||||||||||||
line 156 fromBlankpublic static NImage fromBlank (int $width, int $height, [array $color = Creates blank image.
|
|||||||||||||||||||||
line 93 fromFilepublic static NImage fromFile (string $file, [mixed &$format = Opens image from file.
|
|||||||||||||||||||||
line 130 fromStringpublic static NImage fromString (string $s, [mixed &$format = Create a new image from the image stream in the string.
|
|||||||||||||||||||||
line 207 getHeightpublic int getHeight () Returns image height. Overridden in child classes as:
|
|||||||||||||||||||||
line 234 getImageResourcepublic resource getImageResource () Returns image GD resource. Overridden in child classes as:
|
|||||||||||||||||||||
line 196 getWidthpublic int getWidth () Returns image width. Overridden in child classes as:
|
|||||||||||||||||||||
line 371 placepublic NImage place (NImage $image, [mixed $left = Puts another image into this image.
|
|||||||||||||||||||||
line 248 resizepublic NImage 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 401 savepublic bool save ([string $file = Saves image to the file. Overridden in child classes as:
|
|||||||||||||||||||||
line 474 sendpublic bool send ([int $type = Outputs image to browser.
|
|||||||||||||||||||||
line 219 setImageResourceprotected NImage setImageResource (resource $image) Sets image resource.
|
|||||||||||||||||||||
line 351 sharpenpublic NImage sharpen () Sharpen image.
|
|||||||||||||||||||||
line 442 toStringpublic string toString ([int $type = Outputs image to string.
|
|||||||||||||||||||||
line 493 __callpublic mixed __call (string $name, array $args) Call to undefined method.
|
|||||||||||||||||||||
line 455 __toStringpublic string __toString () Outputs image to string.
|