IBitmapImageClip
BitmapImageSliceClip - load a large image, convert it to a set of smoothed BitmapData objects available for manipulation.This works around the BitmapDataObject 2880 pixel width or height limitation. NOTE: The clip image is automatically hidden (_alpha:0) until manually tweened in by developer.
Usage: import com.sekati.utils.* import caurina.transitions.Tweener; function _onProgress(l:Number, t:Number):Void { trace("img_onProgress: "+l+" / "+t); } function _onInit():Void { Tweener.addTween(image, {_alpha:100, time:0.3, transition:"easeInOutQuint"}); } function _onError(code:String):Void { trace("oh noes! The image couldnt be loaded: "+ecode); } // create an empty BitmapImageClip var image:MovieClip = ClassUtils.createEmptyMovieClip (com.sekati.display.BitmapImageSliceClip, this, "image", {_x:0, _y:0}); // load an image and define onProgress onInit Delegates. image.load("test.jpg", Delegate.create(this, _onInit), Delegate.create(this, _onProgress), Delegate.create(this, _onError));
public function load(uri:String, isSmoothed:Boolean, onInit:Function, onProgress:Function, onError:Function):Void
Load image and convert to bitmap
uri | (String) |
isSmoothed | (Boolean) - enable smoothing on the bitmap. |
onInit | (Function) - cb when image is loaded, converted, ready for use. |
onProgress | (Function) - cb is passed args: bytesLoaded, bytesTotal. |
onError | (Function) - cb is passed arg errorCode, httpStatus. |
Void