IMAGECREATETRUECOLOR(3) 1 IMAGECREATETRUECOLOR(3)imagecreatetruecolor - Create a new true color imageSYNOPSIS
resource imagecreatetruecolor (int $width, int $height)
DESCRIPTION imagecreatetruecolor(3) returns an image identifier representing a black image of the specified size.
Depending on your PHP and GD versions this function is defined or not. With PHP 4.0.6 through 4.1.x this function always exists if the GD
module is loaded, but calling it without GD2 being installed PHP will issue a fatal error and exit. With PHP 4.2.x this behaviour is dif-
ferent in issuing a warning instead of an error. Other versions only define this function, if the correct GD version is installed.
PARAMETERS
o $width
- Image width.
o $height
- Image height.
RETURN VALUES
Returns an image resource identifier on success, FALSE on errors.
EXAMPLES
Example #1
Creating a new GD image stream and outputting an image.
<?php
header ('Content-Type: image/png');
$im = @imagecreatetruecolor(120, 20)
or die('Cannot Initialize new GD image stream');
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
imagepng($im);
imagedestroy($im);
?>
The above example will output something similar to:[NOT DISPLAYABLE MEDIA]Output of example : Creating a new GD image stream and
outputting an image.
NOTES
Note
This function requires GD 2.0.1 or later (2.0.28 or later is recommended).
SEE ALSO imagedestroy(3), imagecreate(3).
PHP Documentation Group IMAGECREATETRUECOLOR(3)
Check Out this Related Man Page
IMAGEXBM(3) 1 IMAGEXBM(3)imagexbm - Output an XBM image to browser or fileSYNOPSIS
bool imagexbm (resource $image, string $filename, [int $foreground])
DESCRIPTION
Outputs or save an XBM version of the given $image.
PARAMETERS
o $
image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3).
o $filename
-The path to save the file to. If not set or NULL, the raw image stream will be outputted directly.
o $foreground
- You can set the foreground color with this parameter by setting an identifier obtained from imagecolorallocate(3). The default
foreground color is black.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Saving an XBM file
<?php
// Create a blank image and add some text
$im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
// Save the image
imagexbm($im, 'simpletext.xbm');
// Free up memory
imagedestroy($im);
?>
Example #2
Saving an XBM file with a different foreground color
<?php
// Create a blank image and add some text
$im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
// Set a replacement foreground color
$foreground_color = imagecolorallocate($im, 255, 0, 0);
// Save the image
imagexbm($im, NULL, $foreground_color);
// Free up memory
imagedestroy($im);
?>
NOTES PHP Documentation Group IMAGEXBM(3)
Hi all,
Suppose i wish to have a file which should be something like this:
ROOH20020406080015000003
RLO00220404144142ENG01
RLO00220404123602ENG01
RLO00220404123602ENG02
As u can seeit contains 3 files.
Basically I want the header in the file to be something like this.
here ROOH will... (2 Replies)
Hello Folks!
Problem in getting image size by using getimagesize() function in PHP, the function is working fine on windows OS, but returning nothing on Unix OS, Please guide me how I could get image size/dimensions on Unix OS, as long as I have understood the problem, it is basically the path... (1 Reply)
hello,
i have a structure defined as follows
struct Image
{
int lenght;
int height;
};
and i have another structure where i declare a array of the above structure
struct ShapeImage
{
Image image;
};
when i compile this code with gcc it shows me the following error :
... (3 Replies)
Hi Guys..
Got a NIM issue.. Am trying to pull a image of a client from NIM server.
am getting the following error... in standard error output..
0042-001 nim: processing error encountered on "master":
Usage: rm File...
Am using the same script to pull image and it works fine..... (1 Reply)
I have installed PHP and now it needs to be reconfigured with few extensions:eg: OCI8, XSL transformation etc.
1. Do I have to recompile PHP, or a few edits to config files will do.
2. Also how to list the options with which PHP is compiled. (1 Reply)
Hello All,
I backed up my RHEL 4 as an image.
Then I restored the image on my machine. Everything went fine but I dont get the normal boot sequence as it used to come when I freshly installed RHEL4.
The messages that are shown when the system boots are something like-
" .....
EXT3-fs:... (2 Replies)
I am using PHP5 in ubuntu 9.10.
First I installed PHP and GD as separate package. I tried doing manipulation with images using php image function. When I try using the function imagefilter(), it was not worked and got the solution that need to compile the PHP with the bundled version of GD. So... (0 Replies)
Hello,
I'm trying to create a VirtualBox "harddisk" and put an dd-image into it. This image shoudn't work as a virtual maschine, I just want to be able to mount it to an folder. How can I do this with an shell script?
Sebi
---------- Post updated at 10:36 AM ---------- Previous update... (0 Replies)
Hey All,
What I'm looking for is a way to rotate an image by non 90 degree angles (ie 90, 180, 270, 360). I am able to do it in PHP, but there are errors in the image, some pixels end up colored incorrectly and the image ends up resized and I lose transparency. I've done my share of searching on... (1 Reply)
Hey guys,
Not sure if this is the best place for this question, but, after using Fedora now for about a year, I'm still getting used to it but I'm using it practically all the time now and instead of having a dual boot with Windows 7, I want to create an image of my Windows 7 installation,... (3 Replies)