AVCaptureSession OnFrame Event? - xamarin.ios

I am trying to make an application that will "trigger" when a certain image is shown on screen. I have the app streaming the camera to the screen inside the app using AVCaptureSession. Now i was wondering how to make some sort of EventHandler for each frame of the video, in which i will check to see if the image contains one of my triggers. Does anyone know the best way to handle this? I could not find any resources on an OnFrame EventHandler for AVCaptureSession.
This is the tutorial i followed for showing the camera on screen
https://github.com/messier16/FullCameraPage/blob/master/FullCameraApp.iOS/CameraPageRenderer.cs
Any advice is awesome. Thank you!

I ended up doing a while loop inside of overriden ViewWillAppear() to grab the frame consistently

Related

How to start and stop a video as well as a Timeline with Vuforia?

I am very new to Unity / Vuforia scripting and really need help.
I have composed a whole Timeline in unity but cannot trigger an event ... there are still code errors ...
In the DefaultTrackableEventHandler script, I understand that you have to attach a piece of code that allows these events to be triggered but I haven't been able to do this for 48 hours. Help from the community would be very useful. please.
Here is the scenario:
When launching the application a video should appear. When the target is found, the video should stop to leave room for the Timeline which is triggered automatically, since the target has been found. If the user loses the target then the Timeleine will have to stop and the starting video will have to start again.
Someone could help me with this problem that has taken my head for 48 hours ...
thank you so much
Looks like you have to write scripts that contains differents functions that manage all those points. One script that starts and stops your video (2 different functions), and a other that starts and stops your timeline. (Don't forget to hide the video when you stop it)
Once you have those scripts you can attach them to a object and then, use them in DefaultTrackableEventHandler. (You add you function to the right event by clicking the + button, dragging your object with the script and choosing the right function to use).
Screenshot of DefaultTrackableEventHandler

Detect whether RPScreenRecorder is recording

In my application, I use AVPlayer to play videos. However, I do not use FairPlay.
I tried to use RPScreenRecorder to detect whether screen recording is on:
[RPScreenRecorder sharedRecorder].isRecording
but that does not work.
Does anyone know how to get whether screen recording is on?
Get the window of your app delegate and check isCaptured:
[appDel.window.screen isCaptured]
That will indicate if anything is "using" the screen: RPScreenRecorder, airplay, or mirroring.
Normally RPScreenRecorder is not compatible with AVplayer. That might be the cause of what you are going through
It is said in actual Documentation here: Here
ReplayKit is incompatible with AVPlayer content.

Where should I use XSP.endAjaxLoading()?

I have a Xpage that takes too long to load. So the client ask me to do a loading indicator.
I searched and found XSP.startAjaxLoading(), that I put in onClientLoad event of the Custom Control.
But now I don't know where should I put XSP.endAjaxLoading() to make the loading screen go away.
I'tried to use in afterRenderResponse and beforeRenderResponse: view.postScript("XSP.endAjaxLoading()"), since this comand is CSJS, but it doesn't work.
Thanks in advance.
I think you want to put it in the onComplete event. That can be difficult to find. You typically need to use the outline control to find it.
I have a video demo on NotesIn9 that has an example on this.
http://www.notesin9.com/2016/02/19/notesin9-188-adding-a-please-wait-to-xpages/?unique=http%3A//www.notesin9.com/2016/02/19/notesin9-188-adding-a-please-wait-to-xpages/
Your attempt (view.postscript) works only with full/partial updates and does not work for page loading.
You have used onClientLoad - which is executed when your page is finished with loading. I guess you get ajax animation after a while and it won't stop.
You should make preload screen - very simple XPage which starts animation and does not care to turn it off. In onClientLoad event redirect to your slow XPage. That will discard the animation.
I'd highly recommend using the Standby Dialog XSnippet https://openntf.org/XSnippets.nsf/snippet.xsp?id=standby-dialog-custom-control. I use it as a standard in all XPages applications.
I used this answer as solution: https://stackoverflow.com/a/35481981/5339322
I've saw it a few days ago, what made me think twice is that using this i should know what is doing my XPages to delay. I ran some tests and discovered what, and it was a call to a method in the afterRestoreView event, then I migrated it to onClientLoad event and used the solution in the answer above cited.
But I'm afraid that I have to keep an eye on it, so if someone adds some code that delays in one of the another events of XPages I have to move it again, of course, if it's possible, if it's not, I'll figure it out something diferent.
Thanks for all the answers ans comments.

Using GDI+ to draw tooltip

I'm new to GDI+ programming and am looking for some advice.
I am loading an image from a file and displaying it using the following functions (some pseudo code included):
Gdiplus::Image *i = new Gdiplus::Image(file, other parameters ... );
Gdiplus::DrawImage(i, other parameters ... );
I would like to associate a tooltip with the image. Is there any way that I can automatically set/attach a tooltip to the Gdiplus::Image objact (or any other Gdiplus control that I wish to draw for that matter)?
If not, how can such functionality be achieved? I have looked at CToolTipCtrl in WTL but don't know how to attach it to the Gdiplus::Image.
Thanks in advance.
After investigating this more, I've realised that this is not possible, so to speak. You must use GDI+ to draw your own tool tip my monitoring mouse events to see when it is hovering over something, then using the device context to do the drawing withing the mouse hover event handler.

Drop and Show files in WPF

How to Drop an image from Client Computer to WPF app.
For example dropping image file from a folder or desktop to WPF app and the dropped image should be saved and showed in that dropped window as just an image.
I've searched here similar questions to my question and I couldn't find what I need.
Please help me!
Thank you in advance :)
In target element (or at the window level) set the AllowDrop property to true. Then provide the element or window the DragDrop event handler.
In the event handler you will be able to get the filepath with something like:
e.Data.GetData(DataFormats.FileDrop, true)
Now that you know the location of the file you can do what you like with it.

Resources