iOS Question Save iBarcode preview as a bitmap?

JackKirk

Well-Known Member
Licensed User
Longtime User
Is it possible to save the iBarcode preview as a bitmap?

I have tried code of the form:
B4X:
Private temp_imageview As ImageView
Private temp_rect As Rect
Private temp_bmp As Bitmap
Private temp_canvas As Canvas

temp_imageview.Initialize("")

Page1.RootPanel.AddView(temp_imageview, 0, 0, Page1.RootPanel.Width, Page1.RootPanel.Height)
temp_imageview.Visible = False

temp_canvas.Initialize(temp_imageview)

temp_rect.Initialize(0, 0, Page1.RootPanel.Width, Page1.RootPanel.Height)

temp_canvas.DrawView(scanner_panel, temp_rect)

temp_canvas.Refresh

temp_bmp = BC_Canvas.CreateBitmap

Dim temp_phone As Phone
temp_phone.AddImageToAlbum(temp_bmp)
where scanner_panel is the panel I have initialized the barcode scanner instance to.

I get a photo which shows all the other views I have dumped into the scanner_panel but no barcode preview.

Thanks in anticipation...
 
Last edited:

JackKirk

Well-Known Member
Licensed User
Longtime User
No NativeObject/Objective C sorcery to do it?

It doesn't have to be a bitmap.
 
Last edited:
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Erel,

OK, I'm up for a challenge - I have been contemplating getting into NativeObject more deeply - are there any resources to help work out how to proceed?

Regards...
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Well I'm still up for it - LLCamera in the iMedia library does a similar thing - any chance of getting a look at that too?
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
What are the legalities, etiquettes, issues etc with getting something like this done by Freelancer or similar?
 
Upvote 0

JanPRO

Well-Known Member
Licensed User
Longtime User
Hi,

attached you can find the modified library source and the compiled library.
I have added the CaptureStillImage method and the CapturingStillImage property, usage:
B4X:
Scanner.CaptureStillImage

Sub _StillImage (Image As Bitmap, Error As Exception) 'also a new event
   If Not(Error) Then
     ImageView1.Bitmap = Image
   Else
     Log(Error.Description)
   End If
End Sub

Jan

Edit: I just see
It doesn't have to be a bitmap.
You can also simply create a snapshot of the preview panel, but the snapshot will be treated as a view and not as a bitmap:
B4X:
Sub Snapshot(Target As View) As View
    Dim NaObj As NativeObject = Target
    Dim SnapshotView As View =  NaObj.RunMethod("snapshotViewAfterScreenUpdates:",Array(True))
    Return SnapshotView
End Sub
 

Attachments

  • iBarcode2.zip
    173.2 KB · Views: 489
  • iBarcode2-Source.zip
    48.5 KB · Views: 468
Last edited:
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
JanPRO,

Thanks so much for your response to my request.

I apologise for my belated response but I have been distracted on the other side of the fence doing these:

https://www.b4x.com/android/forum/threads/programmatically-set-screen-settings.64746/
https://www.b4x.com/android/forum/t...ng-app-with-full-correct-torch-control.64931/

I will get onto this now that these are completed.

The reason for wanting a preview capture capability is to do something similar to the second of the posts above - namely create a real-time brightness stream for more dynamic control of the torch.

Thanks again...
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
JanPRO,

I'm probably doing something stupid but I'm getting the following errors when I try to compile with your iBarcode2 library:

B4X:
B4i version: 2.50
Parsing code.    (0.02s)
Compiling code.    (0.08s)
Compiling layouts code.    (0.00s)
Compiling debugger engine code.    (1.39s)
Building Xcode project    (0.02s)
Sending data to remote compiler.    Error
Out: Build settings from command line:
    ARCHS = armv7
    CODE_SIGN_IDENTITY = iPhone
    CONFIGURATION_BUILD_DIR = /Users/administrator/Documents/UploadedProjects/<user id>/Payload
    OTHER_CODE_SIGN_FLAGS = --keychain <user id>
    PRODUCT_NAME = ZXBarcodeScanner
    PROVISIONING_PROFILE = bf4287f9-efcd-4c12-a3e9-287c3bd094b5

=== BUILD TARGET B4iProject OF PROJECT B4iProject WITH CONFIGURATION Release ===

Check dependencies

Write auxiliary files
write-file /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner.hmap
write-file /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-generated-files.hmap
write-file /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-own-target-headers.hmap
write-file /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-project-headers.hmap
/bin/mkdir -p /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7
write-file /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/ZXBarcodeScanner.LinkFileList
write-file /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-all-target-headers.hmap
write-file /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-all-non-framework-target-headers.hmap

Create product structure
/bin/mkdir -p /Users/administrator/Documents/UploadedProjects/<user id>/Payload/ZXBarcodeScanner.app

ProcessInfoPlistFile Payload/ZXBarcodeScanner.app/Info.plist B4iProject/B4iProject-Info.plist
    cd /Users/administrator/Documents/UploadedProjects/<user id>
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-infoPlistUtility /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/B4iProject-Info.plist -genpkginfo /Users/administrator/Documents/UploadedProjects/<user id>/Payload/ZXBarcodeScanner.app/PkgInfo -expandbuildsettings -format binary -platform iphoneos -o /Users/administrator/Documents/UploadedProjects/<user id>/Payload/ZXBarcodeScanner.app/Info.plist

CompileC build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_main.o B4iProject/b4i_main.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/administrator/Documents/UploadedProjects/<user id>
    export LANG=en_US.US-ASCII
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch armv7 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -gmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/var/folders/lj/wrbzzxds6b53f88_rx3x7c800000gn/C/org.llvm.clang/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -miphoneos-version-min=7.0 -fvisibility=hidden -Wno-sign-conversion -iquote /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-generated-files.hmap -I/Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-own-target-headers.hmap -I/Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-all-target-headers.hmap -iquote /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-project-headers.hmap -I/Users/administrator/Documents/UploadedProjects/<user id>/Payload/include -I/Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources/armv7 -I/Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources -F/Users/administrator/Documents/UploadedProjects/<user id>/Payload -F../../Libs -MMD -MT dependencies -MF /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_main.d --serialize-diagnostics /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_main.dia -c /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_main.m -o /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_main.o
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_main.m:2:
/Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_main.h:4:9: fatal error: 'iBarcode2.h' file not found
#import "iBarcode2.h"
        ^
1 error generated.

CompileC build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/main.o B4iProject/main.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/administrator/Documents/UploadedProjects/<user id>
    export LANG=en_US.US-ASCII
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch armv7 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -gmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/var/folders/lj/wrbzzxds6b53f88_rx3x7c800000gn/C/org.llvm.clang/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -miphoneos-version-min=7.0 -fvisibility=hidden -Wno-sign-conversion -iquote /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-generated-files.hmap -I/Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-own-target-headers.hmap -I/Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-all-target-headers.hmap -iquote /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-project-headers.hmap -I/Users/administrator/Documents/UploadedProjects/<user id>/Payload/include -I/Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources/armv7 -I/Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources -F/Users/administrator/Documents/UploadedProjects/<user id>/Payload -F../../Libs -MMD -MT dependencies -MF /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/main.d --serialize-diagnostics /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/main.dia -c /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/main.m -o /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/main.o

CompileC build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_xtimer.o B4iProject/b4i_xtimer.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/administrator/Documents/UploadedProjects/<user id>
    export LANG=en_US.US-ASCII
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch armv7 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -gmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/var/folders/lj/wrbzzxds6b53f88_rx3x7c800000gn/C/org.llvm.clang/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -miphoneos-version-min=7.0 -fvisibility=hidden -Wno-sign-conversion -iquote /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-generated-files.hmap -I/Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-own-target-headers.hmap -I/Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-all-target-headers.hmap -iquote /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-project-headers.hmap -I/Users/administrator/Documents/UploadedProjects/<user id>/Payload/include -I/Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources/armv7 -I/Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources -F/Users/administrator/Documents/UploadedProjects/<user id>/Payload -F../../Libs -MMD -MT dependencies -MF /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_xtimer.d --serialize-diagnostics /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_xtimer.dia -c /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_xtimer.m -o /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_xtimer.o
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_xtimer.m:2:
/Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_xtimer.h:4:9: fatal error: 'iBarcode2.h' file not found
#import "iBarcode2.h"
        ^
1 error generated.

CompileC build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_zxbarcodescanner.o B4iProject/b4i_zxbarcodescanner.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/administrator/Documents/UploadedProjects/<user id>
    export LANG=en_US.US-ASCII
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch armv7 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -gmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/var/folders/lj/wrbzzxds6b53f88_rx3x7c800000gn/C/org.llvm.clang/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -miphoneos-version-min=7.0 -fvisibility=hidden -Wno-sign-conversion -iquote /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-generated-files.hmap -I/Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-own-target-headers.hmap -I/Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-all-target-headers.hmap -iquote /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/ZXBarcodeScanner-project-headers.hmap -I/Users/administrator/Documents/UploadedProjects/<user id>/Payload/include -I/Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources/armv7 -I/Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources -F/Users/administrator/Documents/UploadedProjects/<user id>/Payload -F../../Libs -MMD -MT dependencies -MF /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_zxbarcodescanner.d --serialize-diagnostics /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_zxbarcodescanner.dia -c /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_zxbarcodescanner.m -o /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_zxbarcodescanner.o
In file included from /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_zxbarcodescanner.m:2:
/Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_zxbarcodescanner.h:4:9: fatal error: 'iBarcode2.h' file not found
#import "iBarcode2.h"
        ^


Error: ** BUILD FAILED **


The following build commands failed:
    CompileC build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_main.o B4iProject/b4i_main.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    CompileC build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_xtimer.o B4iProject/b4i_xtimer.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)

I can see your CaptureStillImage/CapturingStillImage additions in my project so I'm assuming I have installed iBarcode2 libraries correctly in my additional library folder.

I am using the hosted builder - does this represent an additional challenge?

Thanks again...
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Erel,

Can you upload JanPRO's iBarcode2 library to the hosted builder?

Thanks...
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Many thanks...
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Jan,

I'm a bit bamboozled.

I have inserted the xxx.CaptureStillImage in a timer and am hearing a simulated camera shutter noise (which is encouraging).

But I can't work out the precise name of the event sub that receives the bitmap.

You have it as:

_StillImage

I have tried:

_StillImage (B4I IDE objects with Sub _stillimage is not a valid identifier)
StillImage (nothing received)
xxx_StillImage (where xxx is name of BarcodeScanner instance - nothing received)
StillImageOutput (from looking through libiBarcode2.a - nothing received)

I'm out of ideas...
 
Last edited:
Upvote 0

JanPRO

Well-Known Member
Licensed User
Longtime User
Hi,

it must be EventName_StillImage:
B4X:
Scanner.Initialize("Scan",Panel1)

Sub Scan_StillImage (Image As Bitmap, Error As Exception)
If Not(Error) Then
     ImageView1.Bitmap = Image
Else
     Log(Error.Description)
End If
End Sub

Don't use CaptureStillImage in a Timer, instead call it in the StillImage event again.

Jan
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Jan,

Of course (dopey dopey dopey) - I scare myself sometimes as to how tunnel-visioned I get...

In the timer I am coding:

B4X:
If Not(BC_Scanner.CapturingStillImage) Then
     
    BC_Scanner.CaptureStillImage
 
End If

The timer is on 2000 msecs.

Is this OK? - seems to work so far.

Thanks again...
 
Last edited:
Upvote 0
Top