Screenshot of hidden panel/tab with ActiveX

Docking/MDI for Windows Forms Forum

Posted 15 years ago by Felix Deimel
Version: 2.0.0107

I'm currently looking for a good Docking Library and I like yours a lot.
But I have a very specific requirement which none of the currently available libraries, including yours seem to support.

I need to be able to take a screenshots of all tabs in a container including those that are not visible.
This by itself is not a problem and can simply be done by calling the DrawToBitmap method which every System.Windows.Forms.Control supports. But the problems start to occur when using ActiveX controls on those tabs which I make extensive use of. The DrawToBitmap method doesn't support ActiveX controls. There's simply a white rectangle in place of the control.

There are methods available in the WinAPI which support taking screenshots of Windows that are not visible and it doesn't matter what controls are on the Window. The PrintWindow function for example supports that. But it doesn't work with your library. If I try to use it on a control hosted in a container that is currently not active I just get a black image.

So my question is, do you know of a way to take screenshots of all the tabs hosted in a container including those with ActiveX controls?
Or is this something you could implement in your library?

As much as I would love to use your library I can't do without the functionality.

Thx for your time.

Comments (3)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Felix,

Thanks for evaluating our products. Did you try calling the DockManager.Render method? I'm not sure if that would make a difference for you or not, as we don't really test the product with ActiveX controls, but it may work since that is the core code we use to paint the controls.

Actipro Software Support

Posted 15 years ago by Felix Deimel
hmm... doesn't seem to work.
The resulting bitmap just has the background color of the window.

This is the code I've tried:
DocumentWindow win = dockManager.DocumentWindows[1];
Bitmap bmp = new Bitmap(win.Width, win.Height);
Graphics g = Graphics.FromImage(bmp);
PaintEventArgs ea = new PaintEventArgs(g, new Rectangle(0, 0, bmp.Width, bmp.Height));

The DockManager itself doesn't seem to expose a Render method.
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA

Sorry, you're right DockManager wouldn't since it's a component. But if the code you posted doesn't work, then unfortunately we'd be out luck here.

Actipro Software Support

The latest build of this product (v24.1.0) was released 4 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.