LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-20-2005, 02:28 AM   #1
pranith
Member
 
Registered: Sep 2004
Location: Hyd,India
Posts: 83

Rep: Reputation: 15
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
 
Old 06-20-2005, 03:07 AM   #2
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
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.
 
Old 06-21-2005, 01:01 AM   #3
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,451

Rep: Reputation: 96
Quote:
can we draw a line on web page using php
Sure...
PHP Code:
<?php echo '<hr />'?>
 
Old 06-21-2005, 02:13 AM   #4
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61


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

Yves.
 
Old 06-21-2005, 03:40 AM   #5
pranith
Member
 
Registered: Sep 2004
Location: Hyd,India
Posts: 83

Original Poster
Rep: Reputation: 15
hi,
let me make it more clear.We have two points and we have to draw a line segment between them
thanks
bye
pranith
 
Old 06-21-2005, 03:49 AM   #6
r0b0
Member
 
Registered: Aug 2004
Location: Europe
Posts: 602

Rep: Reputation: 49
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.
 
Old 06-21-2005, 04:14 AM   #7
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,451

Rep: Reputation: 96
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)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant make web server run my local web page... Nik0s Linux - Newbie 22 10-08-2006 10:30 PM
updating a line of text on a php web server mrobertson Programming 9 06-15-2005 09:43 AM
Setting a web page with php! mithras Linux - General 14 07-25-2003 03:25 PM
Jerky mouse when web browsers download web page stodge Linux - Software 1 07-08-2003 10:29 PM
Drawing a line chr15t0 Linux - General 1 03-27-2003 03:36 PM


All times are GMT -5. The time now is 03:59 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration