怎么根据两点画线?

liulanger160 2010-07-06 06:39:13
我要做一个统计表,会用到在一个平面上面根据两个点画一条线,两个店是任意来的?请问可用什么方法实现呢,最好用php+css+js
...全文
122 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
美人心计1999 2010-08-04
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 tony0369 的回复:]
学习了!我也是不会这个.....




尖锐湿疣 http://www.wuyouzhiwuye.com
尖锐湿疣危害 http://www.wuyouzhiwuye.com
无忧植物液治疗 http://www.wuyouzhiwuye.com
尖锐湿疣资料 http://www.wuyouzhiwuye.com
[/Quote]
汗,发广告......
Dleno 2010-07-07
  • 打赏
  • 举报
回复
js的存在很多浏览器兼容的问题,直接用程序画,最直接。

<?php
header("Content-type: image/jpeg");
$IM = imagecreate (600,500);
$White = imagecolorallocate($IM,0xf5,0xf5,0xf5);
$Red = imagecolorallocate($IM,0xff,0x00,0x00);
//$LineString=$_GET["LineString"];
//$LineString=$_POST["LineString"];
$LineString="318,135&327,263.25|148.5,263.25&327,262.5|318.75,137.25&148.5,263.25|139.5,137.25&148.5,262.5|138.75,136.5&318,135.75|";//例子
$LineArray=explode("|",$LineString);
foreach($LineArray as $LineData){
$LineChild=explode("&",$LineData);
if(count($LineChild)==2){
$LineStart=explode(",",$LineChild[0]);
$LineEnd=explode(",",$LineChild[1]);
imageline($IM,$LineStart[0],$LineStart[1],$LineEnd[0],$LineEnd[1],$Red);
}
}
imagejpeg($IM);
//imagejpeg($IM,"test.jpg",80);//保存图片.80为图片质量
//推荐用ImagePNG()输出,这样图片质量要好些,文件大小也小些
?>
liulanger160 2010-07-06
  • 打赏
  • 举报
回复
给个例子嘛~
PIGer920 2010-07-06
  • 打赏
  • 举报
回复
用GD也可
CunningBoy 2010-07-06
  • 打赏
  • 举报
回复
JS作图的库
http://www.karlson.ru/jsgraphics/html/index.html

21,887

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧