A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: performance question: runtime bitmaps vs. pngs

  1. #1
    Senior Member fantasio's Avatar
    Join Date
    May 2000
    Location
    at the progress bar
    Posts
    409

    performance question: runtime bitmaps vs. pngs

    hi there,

    i was wondering if creating and using bitmaps from vector images at runtime yields the same performance advante as using "real" bitmpas like pngs...

    any ideas?

  2. #2
    Member
    Join Date
    Aug 2010
    Posts
    65
    yes, externally loaded or runtime generated bitmaps are treated the same, the only difference is that you use more memory by having both the vector and the bitmap versions in memory, im talking about drawing a sprite or movieclip with vector graphics to a bitmapdata object, im not sure about the cacheAsBitmap option though

  3. #3
    Senior Member fantasio's Avatar
    Join Date
    May 2000
    Location
    at the progress bar
    Posts
    409
    ah, ok. but i do not have to keep the the vector in memory.
    i do:
    Code:
    var spr:SuperGreatSomethingSprite=new SuperGreatSomethingSprite()
    var bmd:BitmapData=new Bitmapdata(spr.width,spr.height,true,0)
    bmd.draw(spr);
    var bmp:Bitmap=new Bitmap(bmd);
    addChild(bmp);
    spr=null
    this way there should be no wasted memory, no?

  4. #4
    Member
    Join Date
    Aug 2010
    Posts
    65
    yes the sprite will be cleaned from memory by the garbage collector after some time if you have no more references to it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center