Total members 11895 |It is currently Sun Dec 22, 2024 3:16 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Code:


<?php
    $img
=ImageCreate(200,200);

    
$bgcolor=ImageColorAllocate($img,200,200,200);
    
$red=ImagecolorAllocate($img,255,0,0);
    
$green=ImagecolorAllocate($img,0,255,0);
    
$blue=ImagecolorAllocate($img,0,0,255);
    
$grey=ImagecolorAllocate($img,50,50,50);
    
$black=ImagecolorAllocate($img,0,0,0);
                                                            
    
ImageChar($img,0,20,20,"S",$red);
    
ImageChar($img,1,20,40,"S",$green);
    
ImageChar($img,2,20,60,"S",$blue);
    
ImageChar($img,3,20,80,"S",$grey);
    
ImageChar($img,4,20,100,"S",$black);
    
ImageChar($img,5,20,120,"S",$red);
                                                            
    
ImageCharUp($img,0, 20,160,"S",$red);
    
ImageCharUp($img,1, 40,160,"S",$green);
    
ImageCharUp($img,2, 60,160,"S",$blue);
    
ImageCharUp($img,3, 80,160,"S",$grey);
    
ImageCharUp($img,4,100,160,"S",$black);
    
ImageCharUp($img,5,120,160,"S",$red);
                                                            
    
/*
    RGB Red = 0..255 , Green = 0..255 , Blue = 0..255.
     */
    
ImageSetPixel($img,50,50,$pixelcolor);
    
ImagePNG($img,"pic.png");
    
ImageDestroy($img);

?>




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Draw char with color in php
 Changing the color of a graph draw in java     -  
 Draw a blank Canvas based on the size and color set     -  
 convert char*(number) to required unsigned char*     -  
 Set Implode char     -  
 String char count     -  
 File read by char     -  
 casting to char + end of file     -  
 range of the char type     -  
 Color and CSS     -  
 Help needed in Color class     -  



Topic Tags

PHP Graphics
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com