var bd:BitmapData=new BitmapData(file.width,file.height);
bd.setPixels(new Rectangle(0,0,file.width,file.height),file.raw);
var scale_x_percents:Number = (w/bd.width);
var scale_y_percents:Number = (h/bd.height);
if(!stretch) {
if(bd.width*scale_y_percents>=w) {
scale_x_percents=scale_y_percents;
}
else if(bd.height*scale_x_percents>=h) {
scale_y_percents=scale_x_percents;
}
}
var matrix:Matrix = new Matrix();
matrix.scale(scale_x_percents,scale_y_percents);
var resizedBd:BitmapData = new BitmapData(Math.floor(bd.width*scale_x_percents), Math.floor(bd.height*scale_y_percents), true, 0x000000);
resizedBd.draw(bd, matrix, null, null, null, true); // true is smoothing option, it will blur sharpened pixels
이미지 크기 조정에 문제가 있습니다. 스무딩이 작동하지 않거나 코드에 누락 된 항목이있는 것 같습니다. 어쩌면 매트릭스가 더 있어야할까요?액션 스크립트 : 부드럽게 비트 맵 데이터 크기 조정
원본 이미지 :
http://imageshack.us/a/img28/4784/dc7f2ec4b0f3323cdc4e01e.jpg
하고 결과이다 : 나는 다른 이미지의 무리를 연결할 수 있습니다
http://imageshack.us/a/img855/4784/dc7f2ec4b0f3323cdc4e01e.jpg
. 이상한 픽셀 배열이 존재합니다. 어떻게 든 고칠 수 있습니까?
jpeg 품질 100 % 및 stage.quality = 'best'를 테스트했지만 필요한 품질 결과를 제공하지 못했습니다.
누구? 모든 팁이 할 것입니다. – Somebody
괜찮아요. 나에게 잘 돌아가고 있습니다. 코드가 정상적으로 보인다는 것을 알 수 없습니다. (플랫폼이나 다른 시나리오 또는 외부 구성의 영향을받지 않아야하므로) 말할 필요가 없습니다. 스테이지에 올바른 BitmapData를 추가 하시겠습니까? – Cay
BitmapData는 Loader 객체에서 선택됩니다. 사용자 컴퓨터에서. – Somebody