How do you load a bitmap file into a BitmapData object?

后端 未结 5 1748
遥遥无期
遥遥无期 2020-12-15 21:41

In Flash, the BitmapData object can be used to store bitmaps in RAM, you can later draw them to a MovieClip using the beginBitmapFill() method.

How do you load an ex

5条回答
  •  一向
    一向 (楼主)
    2020-12-15 21:49

    You have to load the external file (.jpg) into a MovieClip and wait for it to load.

    Then take a snapshot of the MovieClip that contains the external file, into your BitmapData object.

    myBitmap = new BitmapData(myMC._width, myMC._height,true,0x00FFFFFF)
    
    myBitmap.draw( myMC)
    

    See Introducing the Image API in Flash 8.

提交回复
热议问题