Warum spielt eigentlich keiner mit getPixel??
....ich sach nur webcam/draw/getPixel, und plötzlich werden die ganzen eyeToy-Spielereien auch in Flash machbar, hier mal etwas code (eclipse/mtasc):
ActionScript:
class webcamClass{
private var __root;
function webcamClass(ref)
{
__root=ref;
//initialisiere BitmapData
var img_bmp = new flash.display.BitmapData(320,240,true);
var bmh=ref.createEmptyMovieClip("bmp_holder",3);
ref.bmp_holder.attachBitmap(img_bmp,1,"auto",true);
var my_cam = Camera.get();
// Setze Bildgröße und Bildrate
my_cam.setMode(320,240, 50);
// Setze Kompression
my_cam.setQuality(32768, 100);
// Setze Schlüsselbildintervalle
my_cam.setKeyFrameInterval(1);
//lade Webcambild als Bitmap
ref.createTextField("tf",2,0,250,320,22);
var my_vid=ref.attachMovie("meinVideo","vid1",1);
my_vid=my_vid.myVid;
my_vid.attachVideo(my_cam);
my_vid._width=320;
my_vid._height=240;
ref.onEnterFrame=function(){
img_bmp.draw(ref.vid1);
ref.tf.text=img_bmp.getPixel(100,100);
}
}
static function main(ref)
{
var app=new webcamClass(ref)
}
}
btw.: das sind jetzt meine ersten zwei Tage mit
as2 und eclipse, falls ich logische Fehler drin habe bitte ich unbedingt um Richtigstellung...
Gruß
Alois