Is it possible to provide a Screen Capture functionality in GEF editors? [message #245597] |
Thu, 18 September 2008 14:06 |
Eclipse User |
|
|
|
Originally posted by: ashar.kpitcummins.com
Hi,
We have a graphical editor for our domain model. The user will be able to
draw some diagrams on it and he will be able to generate a screen. But
right now there is a requirement to provide this editor with a capability
to capture the currently drawn screen using a screen capture button added
on the workbench menu bar. Something similar to the Acrobat Reader's
Capture button.
Can anyone give me any clues as how to do this or is it possible to do in
Eclipse?
The requirement is something like capturing the currently active graphical
editor's contents as an image.
I have come across something called Screen Capture or Snaps in MyEclipse
and as I have not explored what exactly it is... am not sure whether that
is something similar to what I am looking for to give an example of it.
Thank you in advance.
Asha R.
|
|
|
Re: Is it possible to provide a Screen Capture functionality in GEF editors? [message #245611 is a reply to message #245597] |
Thu, 18 September 2008 18:58 |
Eclipse User |
|
|
|
Originally posted by: felix.mayer.erdas.com
With GEF, you can paint your root figure into a GC and then convert the
image into a format which could be put on the clipboard or written to a
file:
Rectangle bounds = figure.getBounds();
Image image = new Image( Display.getDefault(), bounds.width,
bounds.height );
GC gc = new GC( image );
Graphics graphics = new SWTGraphics( gc );
figure.paint( graphics );
graphics.dispose();
gc.dispose();
"Asha R" <ashar@kpitcummins.com> wrote in message
news:b1b850445b30a3bf9120a71ad9140f79$1@www.eclipse.org...
> Hi,
>
> We have a graphical editor for our domain model. The user will be able to
> draw some diagrams on it and he will be able to generate a screen. But
> right now there is a requirement to provide this editor with a capability
> to capture the currently drawn screen using a screen capture button added
> on the workbench menu bar. Something similar to the Acrobat Reader's
> Capture button.
>
> Can anyone give me any clues as how to do this or is it possible to do in
> Eclipse?
>
> The requirement is something like capturing the currently active graphical
> editor's contents as an image.
>
> I have come across something called Screen Capture or Snaps in MyEclipse
> and as I have not explored what exactly it is... am not sure whether that
> is something similar to what I am looking for to give an example of it.
>
> Thank you in advance.
>
> Asha R.
>
|
|
|
|
|
Re: Is it possible to provide a Screen Capture functionality in GEF editors? [message #245626 is a reply to message #245623] |
Fri, 19 September 2008 11:26 |
Eclipse User |
|
|
|
Originally posted by: ashar.kpitcummins.com
Hi,
@Richard,
I found this option 'Save As Image' on the editor we have generated using
GMF. As there was not much documentation available for that we were not
aware of what it does! :)).
I guess the same option can be provided on the workbench menu bar as an
option in case of our requirement to provide some functionality similar to
screen capture :-).
If you have more detail about this please let me know.
Like,
While googling I got to know that 'Save as HTML' generates a set of images
on the editor and also the diagram itself. But I did not find anything
like that on the editor we have generated.
A bug related to that #160386 [
https://bugs.eclipse.org/bugs/show_bug.cgi?id=160386&que ry_format=specific&order=relevance+desc&bug_status=_ _open__
] on bugzilla says something like this...
"Clients that override GMF's UI for exporting diagrams to images have to
write
support code for 'Export to HTML' on the UI side if they wish to have it"
I did not get what is this exactly.
If you have more clarity on this please let me know.
For the sake giving more information on the premises of the requirement to
implement this feature, I would like to add, going forward, we have a
requirement to generate a slideshow of such images, from with in the
editor, using the Screen Capture imeplmented. So, probably knowing more
about this 'Save As HTML' or 'Export as HTML' would help us.
Thank you in advance.
Asha R.
|
|
|
Powered by
FUDForum. Page generated in 0.03217 seconds