flash+php拍照系统源码
时间:2009-02-27
来源:互联网
=700) window.open('http://images.phpfans.net/attach/images/20090227_907241d2e1091c358ba6uuRUpijHFGfN.gif');" onload="if(this.offsetWidth>'700')this.width='700';if(this.offsetHeight>'700')this.height='700';" >
makepic.php源代码:<?php
error_reporting(0);
$w = (int)$_POST['width'];
$h = (int)$_POST['height'];
$img = imagecreatetruecolor($w, $h);
imagefill($img, 0, 0, 0x669966);
$rows = 0;
$cols = 0;
for($rows = 0; $rows < $h; $rows++){
$c_row = explode(\",\", $_POST['px' . $rows]);
for($cols = 0; $cols < $w; $cols++){
$value = $c_row[$cols];
if($value != \"\"){
$hex = $value;
while(strlen($hex) < 6){
$hex = \"0\" . $hex;
}
$r = hexdec(substr($hex, 0, 2));
$g = hexdec(substr($hex, 2, 2));
$b = hexdec(substr($hex, 4, 2));
$test = imagecolorallocate($img, $r, $g, $b);
imagesetpixel($img, $cols, $rows, $test);
}
}
}
$filename=\"upfiles/\".date(\"Y-m-d-H-i-s\",time()).\".jpg\";
header(\"Content-type:image/jpeg\");
imagejpeg($img, $filename, 90);
header(\"Location: $filename\");
?>
flash as源代码参数解释:
import it.sephiroth.mloaderWindow
import it.sephiroth.PrintScreen
myCam = Camera.get(); //获得摄像头句柄
myCam.setMode(160, 120, 10); //三个参数对应: 摄像头区域的 宽、高和帧/s
my_video.attachVideo(myCam);
var loader:mloaderWindow = this.createClassObject(mloaderWindow, \"loader\", 10, {_x:-1000, _y:-1000})
var listener:Object = new Object();
listener.onProgress = function(target:MovieClip, loaded:Number, total:Number){
var perc = Math.round((loaded/total)*100)
loader.label = \"Sending... \" + perc + \"%\"
loader.value = perc
}
listener.onComplete = function(target:MovieClip, load_var

loader.label = \"Sending...\"
load_var.send(\"makepic.php\", \"_self\", \"POST\")
loader.close()
}
function print_me(){
var mc_x = 15;
var mc_y = 15;
my_video.attachVideo(null);
pn = new PrintScreen();
pn.addListener( listener );
pn.print(_root, 0, 0, 250, 120, mc_x, mc_y) //_root为要拷贝屏幕的对象 0,0,代表起点为(0,0) 宽代表高为250 高为120 mc_x和 mc_y代表图片边缘的增量
loader.label = \"输出中... 0%\"
loader.open(true, true, true);
}
作者: 我是疯子 发布时间: 2009-02-27
沙发。 看来做这个应用还要懂AS呀
作者: Fantasy 发布时间: 2009-03-01
xuexiexuexiex
作者: noikiy 发布时间: 2009-04-13
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28