LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   drawing line in php on web page (http://www.linuxquestions.org/questions/programming-9/drawing-line-in-php-on-web-page-335345/)

pranith 06-20-2005 02:28 AM

drawing line in php on web page
 
hi...

can we draw a line on web page using php or some other languages...

thanks....



bye,
Pranith

theYinYeti 06-20-2005 03:07 AM

The perfect solution would be a SVG object inside an XHTML document, but I don't know what is the current status of SVG support.
Else PHP has support for generating images, and I seem to remember there's a pseudo-protocol named 'data:' for embedding the graphics inside the markup.

Yves.

keefaz 06-21-2005 01:01 AM

Quote:

can we draw a line on web page using php
Sure...
PHP Code:

<?php echo '<hr />'?>


theYinYeti 06-21-2005 02:13 AM

:) :)

That's so true! But only for horizontal lines, though.

Yves.

pranith 06-21-2005 03:40 AM

hi,
let me make it more clear.We have two points and we have to draw a line segment between them
thanks
bye
pranith

r0b0 06-21-2005 03:49 AM

Huhl?
I'm sorry but either I missunderstand your question or you have absolutely zero knowledge about web, html and php.
How are the two points specified and what kind of "line" do you have to "draw"?
I suggest you read at least the first chapter of any book on web and html.

keefaz 06-21-2005 04:14 AM

PHP Code:

<?php
header
("Content-type: image/png");

$im = @imagecreate(100100)
   or die(
"Cannot Initialize new GD image stream");
$background_color imagecolorallocate($im
                                
255255255 //white
                                
);

$black imagecolorallocate($im000);
imageline($im,
        
55// first point coordinates
        
80,80// last point coordinates
        
$black);

imagepng($im);
imagedestroy($im);
?>

(requires that php is compiled with gd)


All times are GMT -5. The time now is 05:18 PM.