I have created an AIR application which has two windows. First one is main window(spark Windowed Application) and the second one is a component(spark window). I am using Java to capture the Desktop screen with Flex-Java Bridge Flerry.
Here is the code to capture the screen which is:-
HDC hdcWindow = User32.INSTANCE.GetDC(hWnd);
HDC hdcMemDC = GDI32.INSTANCE.CreateCompatibleDC(hdcWindow);
RECT bounds = new RECT();
User32Extra.INSTANCE.GetClientRect(hWnd, bounds);
int width = bounds.right;
int height = bounds.bottom ;
HBITMAP hBitmap = GDI32.INSTANCE.CreateCompatibleBitmap(hdcWindow, width, height);
HANDLE hOld = GDI32.INSTANCE.SelectObject(hdcMemDC, hBitmap);
GDI32Extra.INSTANCE.BitBlt(hdcMemDC, 0, 0, width, height, hdcWindow, 0, 0, WinGDIExtra.SRCCOPY);
I don't want the main flex window to be captured. It should skipped(transparent) from being captured.
Is that possible by changing the configuration of flex project?
If it cannot be done in flex and java, in what platform it can be done?
If I understood correctly your problem.
You can use built in Flex/as3 function to take a screenshot of the entire application or a particular component then convert into bytearray and PngEncoder (or JPGEncoder if you prefer), than save it...
Here's an example:
EDIT:
As I thought I misunderstood the request..
The only way I can think of is to:
this.minimize();
) or setting the alpha to 0 (this.alpha=0
).this.maximize();
) or setting the alpha to 1 (this.alpha=0
).