+ -
当前位置:首页 → 问答吧 → flash+php拍照系统源码

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_varoadVars){
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

热门下载

更多