|
|
|
Re: Copy GEF diagram as WMF? [message #195433 is a reply to message #195388] |
Fri, 09 September 2005 18:21 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
I think SWT is irrelevant since you're trying to capture Draw2d figures.
You can ask on the SWT newsgroup to be sure, but AFAIK there's no such
support in SWT either.
You can, however, capture the GEF diagram as an Image. So you might want to
see if you can find a converter that can convert the image into the WMF
format.
"Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
news:dfsh6f$gl$1@news.eclipse.org...
> Is that no to both questions or just the first one?
>
> "Pratik Shah" <none@unknown.com> wrote in message
> news:dfpr3h$juj$1@news.eclipse.org...
> > Sorry, no.
> >
> > "Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
> > news:dfkr6e$qs$1@news.eclipse.org...
> >> Does the GEF have support to copy a diagram as a WMF (Windows Meta
File)
> > via
> >> the clipboard to another application? Or maybe this is part of SWT?
> >>
> >>
> >
> >
>
>
|
|
|
|
Re: Copy GEF diagram as WMF? [message #195716 is a reply to message #195448] |
Tue, 13 September 2005 07:30 |
Eclipse User |
|
|
|
Originally posted by: markus.nosse.gmx.net
Hi,
I have implemented a function to save a gef viewer as an image. One
possibility is to create an (SWT) image in memory and paint the figure you
want into this image. Here is how I did it:
ScrollingGraphicalViewer viewer = ...;
// get printable layers, only those will be included in the image
LayerManager lm =
(LayerManager)viewer.getEditPartRegistry().get(LayerManager. ID);
IFigure f = lm.getLayer(LayerConstants.PRINTABLE_LAYERS);
// use SWT features to capture the image
Image capture = new Image(viewer.getControl().getDisplay(),
f.getBounds().width, f.getBounds().height);
GC imageGC = new GC(capture);
Graphics graphics = new SWTGraphics(imageGC);
f.paint(graphics);
// save captured image to a file. again, this is SWT.
// Note that in v2.1 not too many graphic formats are supported.
// Refer to the ImageLoader source code to learn more
try {
ImageLoader imageloader = new ImageLoader();
imageloader.data = new ImageData[1];
imageloader.data[0] = capture.getImageData();
imageloader.save(filename, SWT.IMAGE_BMP);
} finally {
graphics.dispose();
imageGC.dispose();
capture.dispose();
}
-- markus
|
|
|
Re: Copy GEF diagram as WMF? [message #195753 is a reply to message #195716] |
Tue, 13 September 2005 13:46 |
Eclipse User |
|
|
|
Originally posted by: sunil_kamath.nohotspammail.com
"Markus" <markus.nosse@gmx.net> wrote in message
news:575e57d9bd925b92558b042a83a09ced$1@www.eclipse.org...
> Hi,
>
> I have implemented a function to save a gef viewer as an image. One
> possibility is to create an (SWT) image in memory and paint the figure you
> want into this image. Here is how I did it:
>
[snip]
GEF already does this.
See org.eclipse.draw2d.parts.ScrollableThumbnal, specifically the
SelectorFigure inner class.
---
Sunil
|
|
|
|
|
Re: Copy GEF diagram as WMF? [message #243415 is a reply to message #201333] |
Fri, 06 June 2008 03:51 |
Eclipse User |
|
|
|
Originally posted by: nhadt.cybersoft-vn.com
Dear all,
Does someone know what is the license for Image data transfer written by
Philip Schatz?
Thanks a lot,
Nha Dang
benedict heal wrote:
>
> For saving the image to the clipboard in BMP format, there is a very
> useful data transfer class written by Philip Schatz at:
>
> http://www.philschatz.com/space/ImageDataTransfer/
>
> Benedict
>
>
>
> Sunil Kamath wrote:
>> "Markus" <markus.nosse@gmx.net> wrote in message
>> news:575e57d9bd925b92558b042a83a09ced$1@www.eclipse.org...
>>
>>> Hi,
>>>
>>> I have implemented a function to save a gef viewer as an image. One
>>> possibility is to create an (SWT) image in memory and paint the
>>> figure you want into this image. Here is how I did it:
>>>
>>
>> [snip]
>>
>> GEF already does this.
>> See org.eclipse.draw2d.parts.ScrollableThumbnal, specifically the
>> SelectorFigure inner class.
>> ---
>> Sunil
>>
|
|
|
Powered by
FUDForum. Page generated in 0.25945 seconds