|
Re: How I can capture a SWT Widget FULL Image? [message #451368 is a reply to message #451315] |
Mon, 28 February 2005 06:16 |
Konstantin Scheglov Messages: 555 Registered: July 2009 |
Senior Member |
|
|
David Díaz :
Under Windows probably yes.
You could create same Tree on Shell that is not visible on screen,
make it big enough to fix full tree and use WM_PRINT (see MSDN) to get
image. But this is not portable, so try to find better solution.
> Hi.
>
> I'm using a Treeviewer and I capture the image that is showing when
> I execute the program with this lines:
>
>
> Point size = treeviewer.getTree().getSize();
> GC gc = new GC(treeviewer.getTree());
> Display display2 = treeviewer.getTree().getDisplay();
> final Image image = new Image(display2, size.x, size.y);
> gc.copyArea(image, 0, 0);
>
> The problem is that the tree as hidden zones visibles only moving the
> scrolls barsa nd theimage only shows the image that the user views.
>
> I need capture an image complete of the tree, without scrollbars and
> without hidden zones.
>
> can I do this?
>
--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)
Konstantin Scheglov,
Google, Inc.
|
|
|
|
Re: How I can capture a SWT Widget FULL Image? [message #451394 is a reply to message #451376] |
Tue, 01 March 2005 05:17 |
Konstantin Scheglov Messages: 555 Registered: July 2009 |
Senior Member |
|
|
David Díaz:
> The problem is that I don't know the tree size.
>
> I can write '.expandAll' to expand all the tree components but I don't
> know the size of this 'open tree' to create a new component with this
> size and print.
>
> can I do something?
>
I am not sure, but you can try to use Control.computeSize() with
SWT.DEFAULT sizes.
> Many Thanks!!!
>
>
>
> Konstantin Scheglov wrote:
>
>> David Díaz :
>
>
>> Under Windows probably yes.
>> You could create same Tree on Shell that is not visible on screen,
>> make it big enough to fix full tree and use WM_PRINT (see MSDN) to get
>> image. But this is not portable, so try to find better solution.
>
>
>>> Hi.
>>>
>>> I'm using a Treeviewer and I capture the image that is showing when
>>> I execute the program with this lines:
>>>
>>>
>>> Point size = treeviewer.getTree().getSize();
>>> GC gc = new GC(treeviewer.getTree());
>>> Display display2 = treeviewer.getTree().getDisplay();
>>> final Image image = new Image(display2, size.x, size.y);
>>> gc.copyArea(image, 0, 0);
>>>
>>> The problem is that the tree as hidden zones visibles only moving the
>>> scrolls barsa nd theimage only shows the image that the user views.
>>>
>>> I need capture an image complete of the tree, without scrollbars and
>>> without hidden zones.
>>>
>>> can I do this?
>>>
>
>
>
>
--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)
Konstantin Scheglov,
Google, Inc.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02512 seconds