Label

  • ActionScript 2
  • AD Player 2
  • Algorithm 2
  • AS3 16
  • Audio 1
  • Audio Description Player 1
  • Bitmap 1
  • BitmapData 1
  • Browser 1
  • C# Experience 4
  • Chart 1
  • Flash 10
  • Game 1
  • Geometry 1
  • JavaScript 2
  • Mathematics 6
  • Music Online 1
  • MVC 1
  • Performance 1
  • PureMVC 1
  • Slide 1
  • Talks 1
  • Tool 1
  • Tool Player 1
Toggle Side
Home   »   Flash   »   MovieMix and MoviePix width demo

MovieMix and MoviePix width demo

MovieMix
MovieMix is a Class transcribed by another Class of the author Sascha on blog.hexagonstar.com
Its mission is to turn a regular bitmap into animated bitmap. I was surprised and delighted to extend it, From there, I've developed based on the Hexagonstar's AnimatedBitmap in the first version.
In the AnimatedBitmap, data input into is a BitmapData(ImageSequence a horizontal line)

Corresponds to rendering:
//thisbuffer as ImageSequence a horizontal line
bitmapData.copyPixels(thisbuffer, new Rectangle((framenr - 1) * onwidth, 0, onwidth, onheight), new Point());
In the MovieMix, data input into is a list BitmapData that stored in DataMix.
Corresponds to rendering:
var db:BitmapData = listbitmap[framenr - 1]; // listbitmap as Array
bitmapData.copyPixels(db,db.rect,new Point(0,0));

Oh yes, reading from Array list to get BitmapData, maybe you'll appreciate it not better by shifting the position, because the process of reading data in an array will take the CPU processing time,
you're right but be assured, processing time there is will not come up too costly in the case of small array.

Anyway, here is a great performance tester written by author Nicolas.
http://bimeanalytics.com/projects/performance_tester/performanceTester.html

And here is my demo:




MovieMix with data is Array of the BimapData



MoviePix
To expand my method to render data I write a different class, instead of read from Array as MovieMix, I'll write to read from BitmapData, Bitmap is an ImageSequence(multi line) and I named it as MoviePix.
For the process of writing a BitmapData and reading BitmapData is the same correlative, I created a "Big BitmapData" in DataMix (read more wiki DataMix version 1.0.0.4 here) and readed same method:
var thisframe:Number = framenr - 1;
var sizeW:Number = this.width;
var sizeH:Number = this.height;
var bufW:Number = thisbuffer.width;
var bufH:Number = thisbuffer.height;
var column:Number = bufW / sizeW;
var x:Number = ( thisframe % column ) * sizeW;
var y:Number = Math.floor( thisframe / column ) * sizeH;
//thisbuffer as Image sequence multi lines
bitmapData.copyPixels(thisbuffer, new Rectangle(x, y, sizeW, sizeH), new Point());
The above method rended by shifting the position, you can fully trust that it runs lighter then reading from the array.

For demo to easily imagine.





MoviePix with data is a big of the BimapData




Flowchart:
DataMix offers two types of data, an Array BitmapData and a Big BitmapData

Reference:

http://blog.odcup.com/2011/12/movieclip-to-animated-bitmap.html
http://blog.hexagonstar.com/animatedbitmapclass/
http://bimeanalytics.com/projects/performance_tester/performanceTester.html
http://jacksondunstan.com/articles/479


Labels: AS3 ,  Flash   at:  10:33 PM     Email This BlogThis! Share to X Share to Facebook

0 comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments ( Atom)
© Hung Le 2007-2016. Powered by Blogger