Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » ImageDataCollector / ScreenScraping
ImageDataCollector / ScreenScraping [message #139420] Mon, 30 July 2007 15:19 Go to next message
Stefan Kuhn is currently offline Stefan Kuhn
Messages: 355
Registered: July 2009
Senior Member
hi all,

I would like to use VE ability to make a screenshot of a SWT composite
in my GMF Editor. When I looked at the implementation I noticed it is
very platform specific.

Basically I just need following method of
org.eclipse.ve.internal.swt.targetvm.ImageCapture:

protected abstract Image getImage(Control control, int maxWidth, int
maxHeight, boolean includeChildren);

even easier, "Image getImage(Control)" without children would be sufficient.

I found the OS branching stuff in
org.eclipse.ve.internal.swt.ImageDataCollector
looking like:
if (Platform.OS_WIN32.equals(Platform.getOS()))
dataCollectorType =
(...)("org.eclipse.ve.internal.swt.targetvm.win32.ImageCapture ");
else if (Platform.WS_GTK.equals(Platform.getWS())){
....

Is it a good approach to implement the branching stuff and copy the
three classes to make it work? (these classes are not exported in VE). I
also noticed that these classes are 2+ years old, is there already a
replacement?

Is it possible to do it this way? How would you suggest realizing it?

thanks & regards
stefan
Re: ImageDataCollector / ScreenScraping [message #140357 is a reply to message #139420] Thu, 13 September 2007 16:16 Go to previous messageGo to next message
Philippe Ombredanne is currently offline Philippe Ombredanne
Messages: 386
Registered: July 2009
Senior Member
"SKuhn" <kuhn@oio.de> wrote in message
news:f8kvis$10d$1@build.eclipse.org...
> hi all,
>
> I would like to use VE ability to make a screenshot of a SWT composite
> in my GMF Editor. When I looked at the implementation I noticed it is
> very platform specific.
Have you looked at the SWT snippet for capturing screen images too?
It is not platform specific.
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet95. java

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet215 .java

> I found the OS branching stuff in
> org.eclipse.ve.internal.swt.ImageDataCollector
> looking like:
> if (Platform.OS_WIN32.equals(Platform.getOS()))
> dataCollectorType =
> (...)("org.eclipse.ve.internal.swt.targetvm.win32.ImageCapture ");
> else if (Platform.WS_GTK.equals(Platform.getWS())){
> ...
>
> Is it a good approach to implement the branching stuff and copy the
> three classes to make it work? (these classes are not exported in VE). I
> also noticed that these classes are 2+ years old, is there already a
> replacement?
The code is 2 years old, but works. If that is what you need, copying and
branching is fine.
I would suggest that if you project is not open source you keep that
branched code in a separate bundle, so that you can release the forked
sources as per the EPL.

> Is it possible to do it this way? How would you suggest realizing it?
>
> thanks & regards
> stefan
Re: ImageDataCollector / ScreenScraping [message #140462 is a reply to message #140357] Thu, 13 September 2007 17:39 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
Philippe Ombredanne wrote:


>> I would like to use VE ability to make a screenshot of a SWT composite
>> in my GMF Editor. When I looked at the implementation I noticed it is
>> very platform specific.
> Have you looked at the SWT snippet for capturing screen images too?
> It is not platform specific.
> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet95. java
>
> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet215 .java

This requires that Shell with GUI is visible on screen, so it will
flash and annoy user.


Konstantin Scheglov,
Google, Inc.
Re: ImageDataCollector / ScreenScraping [message #140493 is a reply to message #140462] Thu, 13 September 2007 18:21 Go to previous messageGo to next message
Philippe Ombredanne is currently offline Philippe Ombredanne
Messages: 386
Registered: July 2009
Senior Member
"Konstantin Scheglov" <kscheglov@gmail.com> wrote in message
news:fcbsjt$4ee$1@build.eclipse.org...
> Philippe Ombredanne wrote:
> >> I would like to use VE ability to make a screenshot of a SWT composite
> >> in my GMF Editor. When I looked at the implementation I noticed it is
> >> very platform specific.
> > Have you looked at the SWT snippet for capturing screen images too?
> > It is not platform specific.
> >
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet95. java
> >
> >
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet215 .java
>
> This requires that Shell with GUI is visible on screen, so it will
> flash and annoy user.
Would you know how to do it best then?
Re: ImageDataCollector / ScreenScraping [message #140504 is a reply to message #140493] Fri, 14 September 2007 03:13 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
Philippe Ombredanne wrote:


>>> Have you looked at the SWT snippet for capturing screen images too?
>>> It is not platform specific.
>>>
> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet95. java
>>>
> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet215 .java
>> This requires that Shell with GUI is visible on screen, so it will
>> flash and annoy user.
> Would you know how to do it best then?

Solution in VE is good enough.
Yes, it is platform specific, but there are no other way.


Konstantin Scheglov,
Google, Inc.
Re: ImageDataCollector / ScreenScraping [message #140545 is a reply to message #140504] Fri, 14 September 2007 15:25 Go to previous messageGo to next message
Philippe Ombredanne is currently offline Philippe Ombredanne
Messages: 386
Registered: July 2009
Senior Member
"Konstantin Scheglov" <kscheglov@gmail.com> wrote in message
news:fccu8f$t1d$1@build.eclipse.org...
> Philippe Ombredanne wrote:
>
>
> >>> Have you looked at the SWT snippet for capturing screen images too?
> >>> It is not platform specific.
> >>>
> >
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet95. java
> >>>
> >
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet215 .java
> >> This requires that Shell with GUI is visible on screen, so it will
> >> flash and annoy user.
> > Would you know how to do it best then?
>
> Solution in VE is good enough.
> Yes, it is platform specific, but there are no other way.

Konstantin:
Would you know of a better solution than good enough?
Are ether flaws in the current one?
What could be improved?
(from googling your name you seem to know more than a thing or two on the
topic of visual editing, your help would matter a lot if you care for VE)
:-P
Re: ImageDataCollector / ScreenScraping [message #140568 is a reply to message #140545] Fri, 14 September 2007 16:57 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
Philippe Ombredanne wrote:

>> Solution in VE is good enough.
>> Yes, it is platform specific, but there are no other way.
>
> Konstantin:
> Would you know of a better solution than good enough?
> Are ether flaws in the current one?
> What could be improved?

I have not looked in VE screen shot making precisely. I just know
that they use native code and it is known that ther are no other good
way. For Win32 you can use OS.SendMessage(), for Linux and Mac native
code is unavoidable.


> (from googling your name you seem to know more than a thing or two on the
> topic of visual editing, your help would matter a lot if you care for VE)

:-)

In reallity screen shot making is the simplest part of WYSIWYG GUI
editor.


Konstantin Scheglov,
Google, Inc.
Contributing to VE [wa Re: ImageDataCollector / ScreenScraping] [message #140574 is a reply to message #140568] Sat, 15 September 2007 05:44 Go to previous message
Philippe Ombredanne is currently offline Philippe Ombredanne
Messages: 386
Registered: July 2009
Senior Member
Konstantin Scheglov" <kscheglov@gmail.com> wrote in message
news:fceehg$dot$1@build.eclipse.org...
> > (from googling your name you seem to know more than a thing or two on
the
> > topic of visual editing, your help would matter a lot if you care for
VE)
>
> :-)
>
> In reallity screen shot making is the simplest part of WYSIWYG GUI
> editor.
agreed, is there an area of interest wher you think you could help?
Re: ImageDataCollector / ScreenScraping [message #616513 is a reply to message #139420] Thu, 13 September 2007 16:16 Go to previous message
Philippe Ombredanne is currently offline Philippe Ombredanne
Messages: 386
Registered: July 2009
Senior Member
"SKuhn" <kuhn@oio.de> wrote in message
news:f8kvis$10d$1@build.eclipse.org...
> hi all,
>
> I would like to use VE ability to make a screenshot of a SWT composite
> in my GMF Editor. When I looked at the implementation I noticed it is
> very platform specific.
Have you looked at the SWT snippet for capturing screen images too?
It is not platform specific.
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet95. java

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet215 .java

> I found the OS branching stuff in
> org.eclipse.ve.internal.swt.ImageDataCollector
> looking like:
> if (Platform.OS_WIN32.equals(Platform.getOS()))
> dataCollectorType =
> (...)("org.eclipse.ve.internal.swt.targetvm.win32.ImageCapture ");
> else if (Platform.WS_GTK.equals(Platform.getWS())){
> ...
>
> Is it a good approach to implement the branching stuff and copy the
> three classes to make it work? (these classes are not exported in VE). I
> also noticed that these classes are 2+ years old, is there already a
> replacement?
The code is 2 years old, but works. If that is what you need, copying and
branching is fine.
I would suggest that if you project is not open source you keep that
branched code in a separate bundle, so that you can release the forked
sources as per the EPL.

> Is it possible to do it this way? How would you suggest realizing it?
>
> thanks & regards
> stefan
Re: ImageDataCollector / ScreenScraping [message #616542 is a reply to message #140357] Thu, 13 September 2007 17:39 Go to previous message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
Philippe Ombredanne wrote:


>> I would like to use VE ability to make a screenshot of a SWT composite
>> in my GMF Editor. When I looked at the implementation I noticed it is
>> very platform specific.
> Have you looked at the SWT snippet for capturing screen images too?
> It is not platform specific.
> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet95. java
>
> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet215 .java

This requires that Shell with GUI is visible on screen, so it will
flash and annoy user.


Konstantin Scheglov,
Google, Inc.
Re: ImageDataCollector / ScreenScraping [message #616549 is a reply to message #140462] Thu, 13 September 2007 18:21 Go to previous message
Philippe Ombredanne is currently offline Philippe Ombredanne
Messages: 386
Registered: July 2009
Senior Member
"Konstantin Scheglov" <kscheglov@gmail.com> wrote in message
news:fcbsjt$4ee$1@build.eclipse.org...
> Philippe Ombredanne wrote:
> >> I would like to use VE ability to make a screenshot of a SWT composite
> >> in my GMF Editor. When I looked at the implementation I noticed it is
> >> very platform specific.
> > Have you looked at the SWT snippet for capturing screen images too?
> > It is not platform specific.
> >
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet95. java
> >
> >
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet215 .java
>
> This requires that Shell with GUI is visible on screen, so it will
> flash and annoy user.
Would you know how to do it best then?
Re: ImageDataCollector / ScreenScraping [message #616550 is a reply to message #140493] Fri, 14 September 2007 03:13 Go to previous message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
Philippe Ombredanne wrote:


>>> Have you looked at the SWT snippet for capturing screen images too?
>>> It is not platform specific.
>>>
> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet95. java
>>>
> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet215 .java
>> This requires that Shell with GUI is visible on screen, so it will
>> flash and annoy user.
> Would you know how to do it best then?

Solution in VE is good enough.
Yes, it is platform specific, but there are no other way.


Konstantin Scheglov,
Google, Inc.
Re: ImageDataCollector / ScreenScraping [message #616556 is a reply to message #140504] Fri, 14 September 2007 15:25 Go to previous message
Philippe Ombredanne is currently offline Philippe Ombredanne
Messages: 386
Registered: July 2009
Senior Member
"Konstantin Scheglov" <kscheglov@gmail.com> wrote in message
news:fccu8f$t1d$1@build.eclipse.org...
> Philippe Ombredanne wrote:
>
>
> >>> Have you looked at the SWT snippet for capturing screen images too?
> >>> It is not platform specific.
> >>>
> >
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet95. java
> >>>
> >
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet215 .java
> >> This requires that Shell with GUI is visible on screen, so it will
> >> flash and annoy user.
> > Would you know how to do it best then?
>
> Solution in VE is good enough.
> Yes, it is platform specific, but there are no other way.

Konstantin:
Would you know of a better solution than good enough?
Are ether flaws in the current one?
What could be improved?
(from googling your name you seem to know more than a thing or two on the
topic of visual editing, your help would matter a lot if you care for VE)
:-P
Re: ImageDataCollector / ScreenScraping [message #616558 is a reply to message #140545] Fri, 14 September 2007 16:57 Go to previous message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
Philippe Ombredanne wrote:

>> Solution in VE is good enough.
>> Yes, it is platform specific, but there are no other way.
>
> Konstantin:
> Would you know of a better solution than good enough?
> Are ether flaws in the current one?
> What could be improved?

I have not looked in VE screen shot making precisely. I just know
that they use native code and it is known that ther are no other good
way. For Win32 you can use OS.SendMessage(), for Linux and Mac native
code is unavoidable.


> (from googling your name you seem to know more than a thing or two on the
> topic of visual editing, your help would matter a lot if you care for VE)

:-)

In reallity screen shot making is the simplest part of WYSIWYG GUI
editor.


Konstantin Scheglov,
Google, Inc.
Contributing to VE [wa Re: ImageDataCollector / ScreenScraping] [message #616559 is a reply to message #140568] Sat, 15 September 2007 05:44 Go to previous message
Philippe Ombredanne is currently offline Philippe Ombredanne
Messages: 386
Registered: July 2009
Senior Member
Konstantin Scheglov" <kscheglov@gmail.com> wrote in message
news:fceehg$dot$1@build.eclipse.org...
> > (from googling your name you seem to know more than a thing or two on
the
> > topic of visual editing, your help would matter a lot if you care for
VE)
>
> :-)
>
> In reallity screen shot making is the simplest part of WYSIWYG GUI
> editor.
agreed, is there an area of interest wher you think you could help?
Previous Topic:Anybody is extending VE ? we need your help!
Next Topic:How I can get Propertis ' name from java Class, we need your help!
Goto Forum:
  


Current Time: Sun Sep 21 16:18:39 GMT 2014

Powered by FUDForum. Page generated in 0.02029 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software