5
A
답변
10
당신은 직접 BitmapData
을 확장 할 수 없습니다 볼 수 있지만 당신은 그것의 확장 클론을 만들 수 있습니다. 다음은 BitmapData
의 빠른 예제입니다.
package {
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.geom.Matrix;
import mx.core.BitmapAsset;
public class Test extends Sprite {
[Embed(source="test.jpg")]
private var Image:Class;
public function Test() {
var originalBitmapData:BitmapData = BitmapAsset(new Image()).bitmapData;
function scaleBitmapData(bitmapData:BitmapData, scale:Number):BitmapData {
scale = Math.abs(scale);
var width:int = (bitmapData.width * scale) || 1;
var height:int = (bitmapData.height * scale) || 1;
var transparent:Boolean = bitmapData.transparent;
var result:BitmapData = new BitmapData(width, height, transparent);
var matrix:Matrix = new Matrix();
matrix.scale(scale, scale);
result.draw(bitmapData, matrix);
return result;
}
var bitmapA:Bitmap = new Bitmap(originalBitmapData);
addChild(bitmapA);
var bitmapB:Bitmap = new Bitmap(scaleBitmapData(originalBitmapData, 0.5));
addChild(bitmapB);
}
}
}
2
비트 맵 객체의 너비와 높이를 설정하면 해당 이미지의 크기가 조절되므로 비트 맵 데이터로 비트 맵을 만든 다음 너비/높이를 사용하여 비트 맵을 만들거나 크기 조정 값을 사용하려면 scaleX/Y를 사용하십시오.
var bmp:Bitmap = new Bitmap(bmpData);
bmp.width = 400; // or 600,800 etc.
bmp.height = 400;
비트 맵 객체와 directy 스케일을 사용하지 않는 경우의 BitmapData이 What is the best way to resize a BitmapData object?
관련 문제
- 1. AS3 BitmapData to byteArray
- 2. AS3 BitmapData 알파가있는 CopyPixels
- 3. AS3 bitmapData on nextframe();
- 4. AS3 BitmapData 충돌 감지
- 5. AS3 - bitmapData 가장자리 알파 투명도 문제
- 6. AS3 - BitmapData addChild를 여러 영화 클립에 적용
- 7. AS3 Bitmapdata Canvas 스프레드 시트 로더 도움이 필요합니다.
- 8. AS3 - 너비와 높이가 아닌 너비가 아닌 새 bitmapData 만들기
- 9. 그래픽 객체 bitMapData 유형이 bitmapData 유형과 동일합니까?
- 10. 의 BitmapData
- 11. Convertion bitmapData
- 12. BitmapData Collision
- 13. BitmapData 컷오프
- 14. 어떻게 비트 맵 파일을 BitmapData 객체로로드합니까?
- 15. 잘못된 BitmapData 임의성
- 16. ANE, iOS 및 BitmapData
- 17. 유효하지 않은 BitmapData
- 18. bitmapdata 레코드 비디오
- 19. 잘못된의 BitmapData 오류 # 2015
- 20. BitmapData with Scale9Grid
- 21. 의 BitmapData 생성자 기본
- 22. Firefox : BitmapData Handle?
- 23. BitmapData 및 JpegEncoder 제한점
- 24. AS3 : 유효 비트 맵
- 25. Dojo Logarithmic Axis Scale
- 26. xcode iphone scrollview scale
- 27. HID USB Scale 프로그램
- 28. jQuery scale pulsate
- 29. Scale Imageview 멋지게
- 30. double scale 마우스가있는 Matplotlib