Class com.sekati.display.BitmapImageSliceClip

Implemented Interfaces

IBitmapImageClip

Description

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));
 

Field Index

bmp, img

Method Index

new BitmapImageSliceClip()
load(), unload()

Inherited from BaseClip

Constructor Detail

BitmapImageSliceClip

public function BitmapImageSliceClip()

Constructor

Field Detail

img

public img:MovieClip

bmp

public bmp:Array

Method Detail

load

public function load(uri:String, isSmoothed:Boolean, onInit:Function, onProgress:Function, onError:Function):Void

Load image and convert to bitmap

Parameters

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.

Return

Void

Specified By

load() in com.sekati.display.IBitmapImageClip

unload

public function unload():Void

Remove the bitmap and clips.

Return

Void

Specified By

unload() in com.sekati.display.IBitmapImageClip