How to convert bytearray to image or image to bytearray ?

后端 未结 7 1346
感情败类
感情败类 2020-12-06 18:57

How to assign bytearray value to panel background image. If anybody have idea or experiance plz help me to overcome the problem. BRIEF EXP:

I have panel control an

7条回答
  •  醉梦人生
    2020-12-06 19:39

    I used a flash.display.Loader() to load an image in an array. It has a Complete event that is fired after the image has been loaded. I then draw the image on to a Bitmap which I set to the data of a Image that could be placed in a panel. Hope you can make since of this good luck.

    public static function updateImage(img:Image, matrix:Matrix,
                                       pageDTO:PageDTO, bitmapData:BitmapData):void {
        var loader:flash.display.Loader = new flash.display.Loader();
        loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function (e:Event) : void {
            bitmapData.draw(loader.content, matrix);
            pageViewer.data = new Bitmap(bitmapData);
        });
        loader.loadBytes(pageDTO.thumbnail);
    }
    
    
        
    
    

提交回复
热议问题