Adobe Air: Can you draw something outside of a window? - actionscript-3

For example, how would I draw an image outside of my window area, anywhere on the screen?

It is not possible to draw outside your window. You can however simulate that effect by creating a maximized transparent window and then drawing on it so that it seems you are drawing at arbitrary points on the screen. You will face issues like the visible windows below the transparent window will be inactive till you minimize the transparent window.

You can also create a new window inside your application and place it somewhere on the screen. If you set systemChrome to none it will not have any menu bars and will appear if there is nothing on the screen unless you fill it.
See http://livedocs.adobe.com/flex/3/html/help.html?content=WorkingWithWindows_1.html for more information about windows.
A tutorial to spawn new windows without any menu bars and outlining is here : http://www.adobe.com/devnet/air/flex/quickstart/articles/creating_toast-style_windows.html

Related

How to pin a Rectangle to directly above the Effect Picker UI in Spark AR Studio?

We are designing an experience in Spark AR Studio and have run into a conundrum. Basically, our goal is to pin a Rectangle element containing an image texture so that it always lies just above the effect picker UI in Instagram across all devices, as in the placement in this image:
Goal Placement
We are attempting to accomplish this via pinning the Rectangle item item to the bottom and left side of a Canvas element set to Camera Space and Safe Touch Area. This seems to create a successful positioning like in the Goal Image on some devices, but on others (especially the iPhone 8 and iPhone 11) the image is still partially obscured by the UI, which is counter to our goal.
Here is our scene setup:
Rectangle element properties
The Rectangle element in the Scene panel
The Rectangle's position in the 2D Scene editor
An example of undesired behavior:
The Rectangle is obscured by the Effect UI
We have also tried to achieve this via placing the Rectangle dynamically using the Device Insets patch, but this also seems to not help and only provides an accurate pinning above the UI in some circumstances.
Any advice is greatly appreciated!

Win32 Duplicate, mirror, copy or draw window contents twice, with perfect frame synchronization. For stereo left-eye right-eye rendering

I have written a Win32 C++ program.
I would like to duplicate the visual content of the left window every frame, so it appears at another location on the screen. (One rectangle on the left side of the screen, and an identical rectangle on the right side of the screen.)
This is for stereo rendering, where the left rectangle is seen in the user's left eye, and the right rectangle in the right eye.
The two rectangles must be "frame synced", meaning that they must show the same frame at all times. Or to put it another way, if the right eye is behind the left by "one draw call", then the viewer becomes ill.
NOTE: I have the source code to both windows, because I created them. (Both windows reside within the same exe at the moment.)
What I have tried:
BitBlt(), by drawing a rectangular portion of the desktop HDC into the right-side window. I am calling BitBlt() in the WM_PAINT message of the right-side window: This works, BUT the right-side window is 1-2 frames behind the left.
Potential Solutions:
In the left-window's WM_PAINT message, draw both windows with the same contents. Is this possible somehow?
Use one, single giant window to draw both rectangles. This would mean all drawing occurs in the same WM_PAINT call. However, I do not know how to copy part of a window to another part. I wish I could just tell Win32 to 'draw again', but this time start 1000 pixels to the right...
Do "something" with DirectX. (No idea what.)
Any help would be greatly appreciated!
I don’t know if you still need an answer, but I don’t think you can do it better than using the DWM Thumbnails API [1]. You basically do an association of a region on your window <-> a region of a foreign window, and then each time the windows are composed and presented on the screen, the specified rectangle of the foreign window will be painted on the specified rectangle of your window. DWM will do scaling if necessary and you can also specify a transparency level. This is the most efficient way to do it, as the compositor does all the heavy lifting, so it is at the lowest level you could go without writing kernel mode code (custom drivers etc). You can’t draw on top, and won’t “see” the foreign window data on your window if you BitBlt it for example, as the image is not actually drawn on your window, but overlaid on top when the final image of your window is composed and presented to the user by the window manager. But for most purposes, it works really well.
[1] https://learn.microsoft.com/en-us/windows/win32/dwm/thumbnail-ovw

how to give drop shadow for adobe air window?

I am developing adobe air application.
I am trying to give drop shadow around window in WindowedApplication skin class, But it is not taking the shadow.
I want to give shawdow behind window as seen in Microsoft link application.
Any suggestion or solution are welcome
Thanks
Set none and true in your app descriptor XML to get a transparent and chromeless native window.
Then you would have to add any window decorations you might need back, and add the drop shadow to the top most parent sprite of your window (probably also making the parent sprite's origin and size inset within the native window to account for the drop shadow area).
You can try this example as well

Clear old sprite when draw after resize popup or browser in actionscript

Currently, i have drawing bar chart. My chart will redraw if change width of component. I have using invalidateProperties() and invalidateDisplayList() for bar when redraw, it has redraw with new bar is correctly.
However when resize popup or browser, my chart will be override between new bar(when redraw with new width) and old bar.
Maybe cause, it's not clear old bar when resize popup or browser. I still using (chart as Sprite).graphics.clear(), but this code not execute.
How clear the old sprite, everyone ?

How to add any Component in the JFrame TitleBar

How to add any Component like a JButton on the JFrame TitleBar in java swing.
I assume by "title bar" you think of the header with the window menu button, document or program title and buttons for (typical) maximize, minimize, close.
The window borders are drawn by the operating system (whatever part, e.g. with XServer it would be a window manager most of the time) - usually. And this is what the user wants - usually. Then this part of the window is outside the reach of Swing, you need to add components by native code (JNI or one of its nicer wrappers like JNA).
But you can set a Frame to undecorated via setUndecorated. This leaves the whole window area in your responsibility, you have to draw everything yourself and care for things like draggability of the window. Think of a completely "skinned" application. If the look and feel you use supports drawing of the windows borders (javax.swing.LookAndFeel#getSupportsWindowDecorations()) you don't have to do this yourself but set JFrame.setDefaultLookAndFeelDecorated(), the LookAndFeel will draw the border with Swing components. Then you can add Swing components either by glasspane or by changing the component that draws the title bar.