1920x1080 웹캠 캡처를 캡처하고 캡처 된 새 비트 맵을 만들려고합니다. 모든 치수 설정이 정확하지만, 최종 1920x1080 비트 맵에는 비디오 캡처의 작은 320x240 버전 만 포함되어 있습니다. 도움!AS3 - 새로운 BitmapData로 이어지지 않는 웹캠 비디오 크기 - 기본값은 320x240입니다.
import flash.display.Bitmap;
import flash.display.BitmapData;
var bandwidth:int = 1000; // Maximum amount of bandwidth that the current outgoing video feed can use, in bytes per second.
var quality:int = 100; // This value is 0-100 with 1 being the lowest quality.
var cam:Camera = Camera.getCamera();
cam.setQuality(bandwidth, quality);
cam.setMode(1920,1080,60,true); // setMode(videoWidth, videoHeight, video fps, favor area)
var video:Video = new Video();
video.attachCamera(cam);
video.x = 0;
video.y = -100;
video.width = 1920;
video.height = 1080;
addChild(video);
var bitmapData:BitmapData = new BitmapData(video.width, video.height);
var bitmap:Bitmap = new Bitmap(bitmapData);
bitmap.x = 0;
bitmap.y = 0;
bitmap.width = 1920;
bitmap.height = 1080;
addChild(bitmap);
bitmap.visible = false;
capture_mc.buttonMode = true;
capture_mc.addEventListener(MouseEvent.CLICK,captureImage);
function captureImage(e:MouseEvent):void {
bitmapData.draw(video);
bitmap.visible = true;
}
비디오는 화면의 어떤 크기입니까? 디버거에서 BitmapData 인스턴스의 크기를 추적/검사 해 보았습니까? "320x240 버전"이라면 전체 비트 맵 320x240입니까, 아니면 1600x840 더 비어있는 (기본적으로 흰색) 픽셀입니까? – ericsoco