Sponsored Content
Full Discussion: God
The Lounge What is on Your Mind? Chat with iBot - Our RSS Robot Girl God Post 302077275 by Mr. Suhas on Wednesday 21st of June 2006 03:29:26 AM
Old 06-21-2006
Ya this is true.
 

We Also Found This Discussion For You

1. What is on Your Mind?

The Router God

It is not exactly our scope but a bit of networking knowledge is becoming for any Sysadmin - and, btw., it is a very funny read either: The Router God Especially the "celebrity interviews" they have: The sergeant from "Full Metal Jacket" explains the OSI model Humphrey Bogarts life as a... (1 Reply)
Discussion started by: bakunin
1 Replies
IMAGEPALETTETOTRUECOLOR(3)						 1						IMAGEPALETTETOTRUECOLOR(3)

imagepalettetotruecolor - Converts a palette based image to true color

SYNOPSIS
bool imagepalettetotruecolor (resource $src) DESCRIPTION
Converts a palette based image, created by functions like imagecreate(3) to a true color image, like imagecreatetruecolor(3). PARAMETERS
o $ image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3). RETURN VALUES
Returns TRUE if the convertion was complete, or if the source image already is a true color image, otherwise FALSE is returned. EXAMPLES
Example #1 Converts any image resource to true color <?php // Backwards compatiblity if(!function_exists('imagepalettetotruecolor')) { function imagepalettetotruecolor(&$src) { if(imageistruecolor($src)) { return(true); } $dst = imagecreatetruecolor(imagesx($src), imagesy($src)); imagecopy($dst, $src, 0, 0, 0, 0, imagesx($src), imagesy($src)); imagedestroy($src); $src = $dst; return(true); } } // Helper closure $typeof = function() use($im) { echo 'typeof($im) = ' . (imageistruecolor($im) ? 'true color' : 'palette'), PHP_EOL; }; // Create a palette based image $im = imagecreate(100, 100); $typeof(); // Convert it to true color imagepalettetotruecolor($im); $typeof(); // Free the memory imagedestroy($im); ?> The above example will output: typeof($im) = palette typeof($im) = true color SEE ALSO
imagecreatetruecolor(3), imageistruecolor(3). PHP Documentation Group IMAGEPALETTETOTRUECOLOR(3)
All times are GMT -4. The time now is 11:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy