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 54 |
int | ENLARGE |
1 |
line 44 resizing flags resize() |
string | GIF |
IMAGETYPE_GIF |
line 51 |
string | JPEG |
IMAGETYPE_JPEG |
line 49 |
string | PNG |
IMAGETYPE_PNG |
line 50 |
int | STRETCH |
2 |
line 45 resizing flags resize() |
Variable Summary | ||||
---|---|---|---|---|
static bool | $useImageMagick | FALSE |
line 57 |
Method Details | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line 166 __constructpublic Image __construct (resource $image) Wraps GD image. Overridden in child classes as:
|
|||||||||||||||||||||
line 246 calculateSizepublic array calculateSize (mixed $newWidth, mixed $newHeight, [int $flags = Calculates dimensions of resized image.
|
|||||||||||||||||||||
line 312 croppublic Image crop (int $left, int $top, int $width, int $height) Crops image. Overridden in child classes as:
|
|||||||||||||||||||||
line 140 fromBlankpublic static Image fromBlank (int $width, int $height, [array $color = Creates blank image.
|
|||||||||||||||||||||
line 90 fromFilepublic static Image fromFile (string $file, [mixed &$format = Opens image from file.
|
|||||||||||||||||||||
line 126 fromStringpublic static Image fromString (string $s) Create a new image from the image stream in the string.
|
|||||||||||||||||||||
line 188 getHeightpublic int getHeight () Returns image height. Overridden in child classes as:
|
|||||||||||||||||||||
line 214 getImageResourcepublic resource getImageResource () Returns image GD resource. Overridden in child classes as:
|
|||||||||||||||||||||
line 177 getWidthpublic int getWidth () Returns image width. Overridden in child classes as:
|
|||||||||||||||||||||
line 351 placepublic Image place (Image $image, [mixed $left = Puts another image into this image.
|
|||||||||||||||||||||
line 228 resizepublic Image resize (mixed $newWidth, mixed $newHeight, [int $flags = Resizes image. Overridden in child classes as:
|
|||||||||||||||||||||
line 72 rgbpublic static array rgb (int $red, int $green, int $blue, [int $transparency = Returns RGB color.
|
|||||||||||||||||||||
line 381 savepublic bool save ([string $file = Saves image to the file. Overridden in child classes as:
|
|||||||||||||||||||||
line 454 sendpublic bool send ([int $type = Outputs image to browser.
|
|||||||||||||||||||||
line 200 setImageResourceprotected void setImageResource (resource $image) Sets image resource.
|
|||||||||||||||||||||
line 331 sharpenpublic Image sharpen () Sharpen image.
|
|||||||||||||||||||||
line 422 toStringpublic string toString ([int $type = Outputs image to string.
|
|||||||||||||||||||||
line 473 __callpublic mixed __call (string $name, array $args) Call to undefined method.
|
|||||||||||||||||||||
line 435 __toStringpublic string __toString () Outputs image to string.
|