php - Create image in codeigniter on the fly -


i want create image in codeigniter in simple php using gd functions. have tried following method in controller

function image(){ $my_img = imagecreate( 200, 80 );         $background = imagecolorallocate( $my_img, 0, 0, 255 );         $text_colour = imagecolorallocate( $my_img, 255, 255, 0 );         $line_colour = imagecolorallocate( $my_img, 128, 255, 0 );         imagestring( $my_img, 4, 30, 25, "thesitewizard.com",           $text_colour );         imagesetthickness ( $my_img, 5 );         imageline( $my_img, 30, 45, 165, 45, $line_colour );         //$this->output->set_content_type('image/png');          header( "content-type: image/png" );         imagepng( $my_img );         imagecolordeallocate( $line_color );         imagecolordeallocate( $text_color );         imagecolordeallocate( $background );         imagedestroy( $my_img );         } 

if write code in simple php can see in url http://www.domain.com/image.php if run in codeigniter http://www.domain.com/codeigniter/image unable image.

i have searched around unable find how create image in codeigniter . have found captcha helper create image in same way.

in case want typical image manipulations watermarking, resizing, cropping, etc. , since using code igniter, wanted link imagemoo

http://www.matmoo.com/digital-dribble/codeigniter/image_moo/

of course, depends on want accomplish output image. me, find create base png image file , manipulate there.


Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -