JavaScript Editor Javascript debugger     Website design 


Imagick::newImage

Creates a new image ()
bool Imagick::newImage ( int cols, int rows, ImagickPixel background [, string format] )

Warning:

This function is currently not documented; only the argument list is available.

Warning:

This function is EXPERIMENTAL. The behaviour of this function, the name of this function, and anything else documented about this function may change without notice in a future release of PHP. Use this function at your own risk.

Creates a new image and associates ImagickPixel value as background color

Parameters

cols

Columns in the new image

rows

Rows in the new image

background

The background color used for this image

format

Image format. This parameter was added in Imagick version 2.0.1.

Return Values

Returns TRUE on success.

Examples

Example 1041. Using Imagick::newImage():

Create a new image and display it.

<?php

$image
= new Imagick();
$image->newImage(100, 100, new ImagickPixel('red'));
$image->setImageFormat('png');

header('Content-type: image/png');
echo
$image;

?>