[removed] Render PNG stored as Uint8Array onto Canvas element without Data URI

后端 未结 3 1509
面向向阳花
面向向阳花 2020-12-29 04:51

I\'m trying to render a PNG image that is stored in a javascript Uint8Array. The code that I originally tried was the following:

var imgByteStr         


        
3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-29 04:57

    Full Working Example: (save as .html file and open)

    1: Creates Uint8Array.

    2: Fills it with debug pattern.

    3: Pastes it to canvas element on page.

    Output should like like below:

    
    
    
        
         U8A_TO_CANVAS 
        
        
    
    
    
    
    
    
    
    
    

提交回复
热议问题