Created
December 15, 2015 19:58
-
-
Save mattkenefick/263b75e3330217a33b33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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