Hello StarCrunch,
Referencing earlier thread, “How to sample the color of a pixel of an image”,
https://forums.coronalabs.com/topic/73593-how-to-sample-the-color-of-a-pixel-of-an-image/?hl=pixel
After adding more codes to my program and successfully testing on Simulator/Windows, I am now ready to test deploy on Android. I immediately get an error. I strip the code down to bare minimum. It also gives the same error.
The environment are, Corona Simulator 2018.3258 (Apr 04, 2018) on Windows 10. Tested Android device is a Samsung tablet, v4.4.2, and a LG G4 mobile phone, v6.0. Both devices give same error as below. Build settings has the plugin configured and codes (bare-bone test code and my program) run successfully on Simulator/Windows.
Error message,
“attempt to index local “bm” (a nil value)”
Bare-bone test code, failed with error message above,
local Bytemap = require "plugin.Bytemap" local bm = Bytemap.loadTexture( { filename = "picture1.png", baseDir = system.ResourcesDirectory, } ) local w, h = bm.width, bm.height local alpha = bm:GetBytes( { format = "alpha", } )-- alternatively can grab single pixel here print( bm, w, h, type( alpha ), string.len( alpha ) )
Would appreciate your help again on this.
Thank you.
Regards, Luan