iOS Question Process view returned as a snapshot

JackKirk

Well-Known Member
Licensed User
Longtime User
In this post:

www.b4x.com/android/forum/threads/save-ibarcode-preview-as-a-bitmap.64405/#post-408874

JanPRO suggests a snapshot can be taken of a view by the following code:

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
the snapshot itself being returned as a view.

How can the returned view be processed - e.g. how can the image in the returned view be extracted as a bitmap?

Thanks in advance...
 

JackKirk

Well-Known Member
Licensed User
Longtime User
Erel,

My first post of the thread I referred to above was trying to do that:

https://www.b4x.com/android/forum/threads/save-ibarcode-preview-as-a-bitmap.64405/

I am still trying to get a functional preview capability out of the iBarcode library:

(1) JanPRO graciously provided an iBarcode2 library with a Scanner.CaptureStillImage method which returns a bitmap. I have got this working but it has 2 problems:
  • I have to do a bit of processing on the bitmap that is quite processor intensive which could be avoided if preview image was returned as YUV.
  • Every call to the CaptureStillImage method results in a pseudo camera shutter noise - very unprofessional when you are doing it every 2 secs - I have also mitigated this with:
  • It does not turn the ringer volume right off.
  • There seems to be an (inconclusive) opinion around the web that the calls used will render the app unpublishable on iTunes.
(2) JanPRO suggested a snapshot alternative approach - but what you are saying here makes it unworkable.

All these problems would disappear if an iBarcode preview existed that is taken from the video stream and is supplied as YUV, these seem to suggest it is possible:

http://stackoverflow.com/questions/...deo-from-the-camera-display-it-and-process-it

https://github.com/CyberAgent/iOS-N...5af3b8273a/Source/Camera/NBUCameraView.m#L699

Surely life is not meant to be this difficult with RAD tools...
 
Upvote 0
Top