Narek,
What a potentially fascinating bit of code.
I am trying to use it to extract "brightness" from a bitmap.
I get an error dump:
Unexpected event (missing RaisesSynchronousEvents): event_bc_scanner_stillimage_background:
Error occurred on line: 561 (ZXBarcodeScanner)
-[UIImage object]: unrecognized selector sent to instance 0x155902c0
Stack Trace: (
CoreFoundation <redacted> + 150
libobjc.A.dylib objc_exception_throw + 38
CoreFoundation <redacted> + 0
CoreFoundation <redacted> + 700
CoreFoundation _CF_forwarding_prep_0 + 24
my24-7laundry -[b4i_zxbarcodescanner _event_bc_scanner_stillimage_background::] + 832
CoreFoundation <redacted> + 68
CoreFoundation <redacted> + 292
my24-7laundry +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1786
my24-7laundry -[B4IShell runMethod:] + 574
my24-7laundry -[B4IShell raiseEventImpl:method:args::] + 1998
my24-7laundry __40-[B4IShell raiseEventImpl:method:args::]_block_invoke + 38
libdispatch.dylib <redacted> + 10
libdispatch.dylib <redacted> + 22
libdispatch.dylib <redacted> + 1524
CoreFoundation <redacted> + 8
CoreFoundation <redacted> + 1574
CoreFoundation CFRunLoopRunSpecific + 520
CoreFoundation CFRunLoopRunInMode + 108
GraphicsServices GSEventRunModal + 160
UIKit UIApplicationMain + 144
my24-7laundry main + 108
libdyld.dylib <redacted> + 2
)
When I put the following code in the background task:
559 'Extract bitmap to a byte array
560 Private no As NativeObject = Me
561 Private bmp_bytes() As Byte = no.NSDataToArray(no.RunMethod("BitmapToArray:", Array(Image))) '<<<<<< fails here
If I do the bitmap to byte array conversion outside the background task and pass the byte array to the background task all seems to work fine.
I take it that the bitmap is considered UI? - it isn't really.
The main reason for looking at backgrounding the "brightness" extraction is because the bitmap to byte array conversion is a cycle gobbler.
Any comments or suggestions welcome.
Thanks in anticipation...