Is vuforia's virtual button disable while the imageTarget is lose tracking? - vuforia

I use “extended tracking” mode for my Vuforia, unity project. And I find a problem that when my ARcamera is losing track of the imageTarget(the objects will still display) but the virtual button will not work any more? So my question do these virtual buttons only work while the ARCamera can recognize the imageTarget?

The virtual buttons are not supposed to work when the target is lost, even when using Extended Tracking feature. This is because virtual buttons work by covering specific features of the target, so if there is no target, it cannot work. Extended Tracking feature allows Vuforia to guess and keep telling you what was the position of the target, based on other means, and it does not recognize the existence of virtual buttons by definition.

You can find article about Virtual Buttons on Vuforia Library site here.
There is a paragraph saying:
The rectangle that you define for the area of a Virtual button should be equal to, or greater than, 10% of the overall target area. Button events are triggered when a significant proportion of the features underlying the area of the button are concealed from the camera. This can occur when the user covers the button or otherwise blocks it in the camera view. For this reason, the button should be sized appropriately for the source of the action it is intended to respond to. For example, a button that should be triggered by a user's finger needs to be smaller than one that will be triggered by their entire hand.

The image target is lose tracking
=> Assets => Editor =>Vuforia => Image Target ='your License Manager' => ' your photo' => change texture type into sprite
enter image description here

Related

Win 10: Any way to determine which monitor's taskbar the user clicked to launch an application?

I have a multi-monitor config that duplicates the task bar on each monitor. I also have an application with an icon in the taskbar (thus it shows on all monitors), and I'd like this application to behave differently depending on which monitor the click came from.
Is it possible to determine which monitor's taskbar was used to launch that app? I would just need the API function names (rather than actual code).
Thanks!
Whether or not what I asked in my OP is possible, I found a way to do what I want: Immediately upon launch, I obtain the current mouse position in absolute coordinates. This allows me to determine which monitor the mouse is on, which is almost certainly the monitor holding the taskbar icon used to launch the application.

How to make an overlay which capture no events

I would like to draw some sort of window on top of all the other windows. For example, to display some debugging infos (like conky) or things like a timer.
The main thing is that I would like to able to continue using the other windows while using it (the events go through transparently).
I've tried doing it with pygtk, pyqt and others but can't find a way to make it a real overlay with no event capture.
Is there some low-level x11 solution?
I think the Composite-extension-approach will not work when a compositing manager is running (and thus Composite's overlay window is already used).
Since you explicitly mention "no event capture":
The SHAPE extension allows to set some different shapes for a window. Version 1.1 of this extension added the "input" shape. Just setting this to an empty region should pretty much do what you want.
Some concrete example of exactly what I think you ask for can be found in Conky's source code: http://sources.debian.net/src/conky/1.10.3-1/src/x11.cc/?hl=769#L764-L781
Edit: Since you said that you didn't find anything in Gtk (well, PyGtk), here is the function that you need in Gtk: https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#gdk-window-input-shape-combine-region
You might need Composite extension + GetOverlayWindow request:
Version 0.3 of the protocol adds the Composite Overlay Window, which
provides compositing managers with a surface on which to draw without
interference. This window is always above normal windows and is always
below the screen saver window. It is an InputOutput window whose width
and height are the screen dimensions. Its visual is the root visual
and its border width is zero. Attempts to redirect it using the
composite extension are ignored. This window does not appear in the
reply of the QueryTree request. It is also an override redirect
window. These last two features make it invisible to window managers
and other X11 clients. The only way to access the XID of this window
is via the CompositeGetOverlayWindow request. Initially, the Composite
Overlay Window is unmapped.
CompositeGetOverlayWindow returns the XID of the Composite Overlay
Window. If the window has not yet been mapped, it is mapped by this
request. When all clients who have called this request have terminated
their X11 connections the window is unmapped.
Composite managers may render directly to the Composite Overlay
Window, or they may reparent other windows to be children of this
window and render to these. Multiple clients may render to the
Composite Overlay Window, create child windows of it, reshape it, and
redefine its input region, but the specific arbitration rules followed
by these clients is not defined by this specification; these policies
should be defined by the clients themselves.
C api : XCompositeGetOverlayWindow
PyGTK Solution:
I think the composite and shapes X extensions are sufficiently ubiquitous and shall assume here that they are active on your system. Here's PyGtk code for this:
# avoid title bar and standard window minimize, maximize, close buttons
win.set_decorated(False)
# make the window stick above all others (super button will still override it in the z-order, which is fine)
win.set_keep_above(True)
# make events pass through
region = cairo.Region(cairo.RectangleInt(0, 0, 0, 0))
my_window.input_shape_combine_region(region)
win.show_all()
# set the entire window to be semi-transparent, if we like
win.set_opacity(0.2)
Basically what this does is tell Gtk that other than pixel (0,0) the entire window my_window should not be considered part of itself in terms of event propagation. That in turn, according to my current understanding means that when the pointer moves and clicks, the events go to the underlying window under the pointer position, as if my_window was not there.
Caveat:
This does allow your overlay window being the focus window (due to user-solicited window switching or just because it pops up and gets the focus when your application starts). Which means that for example, keyboard events will still undesirably go to it up until the user has clicked through it to make it lose focus in favor of whatever window is under the cursor. I would likely use the approach described here to iron out this aspect.
If there's a different and proper approach for making a portion of the screen "display stuff but not receive events", without building an oddball window like above over it, I'm happy to learn about it.
I assume that one's particular desktop environment (gnome, unity, etc. on linux) may interfere with this solution depending on version and configuration, on some occasions.

OnTouchListener for a view in Jelly Bean

I have a game Activity, which contains a SurfaceView that fills the whole screen.
The app is declared as fullscreen, and appears as such.
My SurfaceView has an OnTouchListener, which feeds a GestureDetector, with a functionality that works fine on most devices.
The listener is set as simply as:
surface.setOnTouchListener(listener);
However, on Jelly Bean (Nexus 4) , touching the soft buttons (back, home, etc.) generates a touch event in coordinates that are irrelevant to my SurfaceView.
This currently generates weird behaviors.
I can workaround that by simply doing a check on touch events and see if they fit the surface size.
However, I was wondering if there is a more elegant solution - one that will just give me the touch events ONLY from my surface and not from those soft buttons.
This is also crucial in the case that some future devices do different variations of that (putting the soft buttons in the UPPER area, for example).

How to put a button into each card?

I'd like to put a 'next' button onto each card of a stack. In Hypercard I could put buttons into either cards or backgrounds. I have not seen yet how it is possible to make a button appear on each card.
In LiveCode you can create a background group that can be on every card. First create your button(s) select it (them) and press "group" in the toolbar. That will create a group. In the inspector for the group you then select "Behave like a background". All new cards will have your button(s) automatically. If you already created a bunch of cards you can always add the group by selecting "Object => Place Group => " in the menu.
Backgrounds are probably the single biggest thing to unlearn if you're coming from a HyperCard background because they act a bit differently in LiveCode. But they have a lot more power than the old HC backgrounds did, so the pain in making the transition pays off well in the long run.

Flicker-free dialogs with custom controls

I have a problem with MFC dialog boxes that are drawn using derived MFC classes for custom drawing of controls.
One of our customers has a real slow PC with a poor graphics card and even normal Windows dialogs paint quite slow. In our case, the problem is far worse. Each individual control (e.g. buttons, group boxes, labels) can be seen to draw seperately.
In most cases I've overridden/implemented the OnPaint() handlers, thinking that drawing on whatever device context I'm provided should be the way to go.
Ideally, what I would like to do is have all controls painted on an off-screen buffer so that when a dialog repaint is required - bang - it just copies the single rendered image to the screen, rather than painting each control to the screen one by one.
Can somebody please advise me how I can achieve this kind of double-buffering?
I've sort of found the solution to my problem.. By setting the dialog extended style to WS_EX_COMPOSITED, the drawing works nicely.. The problem I'm having now concerns a continuous stream of WM_PAINT and WM_ERASEBKGND messages that I keep getting when this style is enabled.
Does anyone know how I can stop the WM_PAINT/WM_ERASEBKGND messages from continously occurring?

Resources