Skip to main content

Get PNG data of an image (:png_data)

Declaration​

png_data = img:png_data()

Returns​

  • png_data
    String. PNG data. Modifying this data will not affect the image object

Description​

Obtain the PNG data of the image object
Performance: this function copies data twice

Example​

file.writes('/var/mobile/1.png', screen.image():png_data())

Note: This example uses functions outside this chapter screen.image, file.writes