Platforms to show: All Mac Windows Linux Cross-Platform

Back to ContinuityCameraMBS class.

ContinuityCameraMBS.Allow(Handle as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Continuity Camera MBS MacExtras Plugin 22.5 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Whether to allow the control to receive data.
Example
Function Allow(Handle as Integer) Handles Allow as boolean
System.DebugLog CurrentMethodName+": "+Str(Handle)

For Each control As RectControl In allowedControls

// we hit our control
If control.handle = handle Then
Return True
End If


// are we within the coordinates with the mouse?

Var cx As Integer = control.MouseX
Var cy As Integer = control.MouseY

'System.DebugLog Str(cx)+"/"+Str(cy)

Var controlLeft As Integer = control.Left
Var controlTop As Integer = control.top
Var controlRight As Integer = controlLeft + control.Width
Var controlBottom As Integer = controlTop + control.Height

Var win As Window = control.Window // container?
If win <> control.TrueWindow Then
controlLeft = controlLeft + win.Left
controlTop = controlTop + win.Top
controlRight = controlRight + win.Left
controlBottom = controlBottom + win.Top
End If

If cX >= controlLeft And cY >= controlTop And cX < controlRight And cy < controlBottom Then
return true
End If

Next
End Function

Return true to allow or false to disallow.
You may get the call for the control below mouse and for other control below it like containers.
So you may best decide based on the

ContinuityCameraMBS.Received(Data as MemoryBlock, type as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Continuity Camera MBS MacExtras Plugin 22.5 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Data was received.
Example
Sub Received(Data as MemoryBlock, type as String)
Select Case type
Case "JPEG"
WriteFile("import.jpg", data)

Var p As Picture = Picture.FromData(data)
MainWindow.setPicture p

Else
MessageBox "new type: "+type
End Select
End Sub

Alternatively to using the delegate, you can subclass ContinuityCameraMBS and add this event to have a central place to receive data.

The items on this page are in the following plugins: MBS MacExtras Plugin.


The biggest plugin in space...