Skip to content

Instantly share code, notes, and snippets.

@mattkenefick
Created December 15, 2015 19:58
Show Gist options
  • Save mattkenefick/263b75e3330217a33b33 to your computer and use it in GitHub Desktop.
Save mattkenefick/263b75e3330217a33b33 to your computer and use it in GitHub Desktop.
screen = CreateObject("roScreen")
bitmap = CreateObject("roBitmap", { width: 200, height: 200, alphaEnable: false })
' create rectangle shape
bitmap.drawRect(0, 0, 200, 200, &h67827fFF)
' get full bytearray and save raw
byteArray = bitmap.getByteArray(0, 0, 200, 200)
byteArray.writeFile("tmp:/12345.bmp")
' load recently saved bytearray and print it
ba = createObject("roByteArray")
ba.readFile("tmp:/12345.bmp")
print ba.toHexString()
' attempt to load recently saved bytearray as file
bmp2 = CreateObject("roBitmap", "tmp:/12345.bmp")
screen.drawObject(0, 0, bmp2)
' fail
screen.finish()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment