Skip to main content



      Home
Home » Eclipse Projects » Mylyn » Screenshot api for Mylyn.
Screenshot api for Mylyn. [message #50641] Mon, 23 June 2008 07:05 Go to next message
Eclipse UserFriend
Hi,

This is slightly off topic.

I'm looking to capture screenshots for a tool that I'm writing. I've
looked at what mylyn does to capture screenshot and quite like it.

I'm particularly interested in what ScreenShotCreationPage is doing, but
could not quite reproduce a similar functionality:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.mylyn/o rg.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/p rovisional/commons/ui/ScreenshotCreationPage.java?revision=1 .5&root=Tools_Project&view=markup&pathrev=HEAD

This is what I'm doing:


protected static boolean captureScreenshot(final String fileName){
GC gc = new GC(display);

Image image = new Image(display, display.getBounds());
gc.copyArea(image, 0, 0);
gc.dispose();
ImageLoader imageLoader = new ImageLoader();
imageLoader.data = new ImageData[] { image.getImageData() };
imageLoader.save(fileName, SWT.IMAGE_PNG);
}

The screenshot is captured, but for dual display, the image is a overlay
of one screen on top of the other. Mylyn screenshot works just fine.

Is there something wrong in what I'm doing ?

-- Ketan
http://swtbot.org/ - a functional testing tool for SWT/Eclipse
Re: Screenshot api for Mylyn. [message #50670 is a reply to message #50641] Mon, 23 June 2008 19:36 Go to previous messageGo to next message
Eclipse UserFriend
You might want to take a look at this bug that describes a similar problem
that was fixed in Mylyn:

219716: GC.copyArea() does not work for capturing full desktop image if
secondary monitor is at left or above the primary monitor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=219716

Steffen


Ketan Padegaonkar wrote:

> Hi,
>
> This is slightly off topic.
>
> I'm looking to capture screenshots for a tool that I'm writing. I've
> looked at what mylyn does to capture screenshot and quite like it.
>
> I'm particularly interested in what ScreenShotCreationPage is doing, but
> could not quite reproduce a similar functionality:
>
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.mylyn/o rg.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/p rovisional/commons/ui/ScreenshotCreationPage.java?revision=1 .5&root=Tools_Project&view=markup&pathrev=HEAD
>
> This is what I'm doing:
>
>
> protected static boolean captureScreenshot(final String fileName){
> GC gc = new GC(display);
>
> Image image = new Image(display, display.getBounds());
> gc.copyArea(image, 0, 0);
> gc.dispose();
> ImageLoader imageLoader = new ImageLoader();
> imageLoader.data = new ImageData[] { image.getImageData() };
> imageLoader.save(fileName, SWT.IMAGE_PNG);
> }
>
> The screenshot is captured, but for dual display, the image is a overlay
> of one screen on top of the other. Mylyn screenshot works just fine.
>
> Is there something wrong in what I'm doing ?
>
> -- Ketan
> http://swtbot.org/ - a functional testing tool for SWT/Eclipse
Re: Screenshot api for Mylyn. [message #50698 is a reply to message #50670] Tue, 24 June 2008 01:55 Go to previous messageGo to next message
Eclipse UserFriend
Hi Steffen,

Thanks for your response.

Is there a workaround for this issue ? I'm using eclipse 3.3 and not
3.3.x. I could not find a workaround for this, or I'm not looking at the
right place.

-- Ketan

Steffen Pingel wrote:
> You might want to take a look at this bug that describes a similar problem
> that was fixed in Mylyn:
>
> 219716: GC.copyArea() does not work for capturing full desktop image if
> secondary monitor is at left or above the primary monitor
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=219716
>
> Steffen
>
>
> Ketan Padegaonkar wrote:
>
>> Hi,
>>
>> This is slightly off topic.
>>
>> I'm looking to capture screenshots for a tool that I'm writing. I've
>> looked at what mylyn does to capture screenshot and quite like it.
>>
>> I'm particularly interested in what ScreenShotCreationPage is doing, but
>> could not quite reproduce a similar functionality:
>>
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.mylyn/o rg.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/p rovisional/commons/ui/ScreenshotCreationPage.java?revision=1 .5&root=Tools_Project&view=markup&pathrev=HEAD
>> This is what I'm doing:
>>
>>
>> protected static boolean captureScreenshot(final String fileName){
>> GC gc = new GC(display);
>>
>> Image image = new Image(display, display.getBounds());
>> gc.copyArea(image, 0, 0);
>> gc.dispose();
>> ImageLoader imageLoader = new ImageLoader();
>> imageLoader.data = new ImageData[] { image.getImageData() };
>> imageLoader.save(fileName, SWT.IMAGE_PNG);
>> }
>>
>> The screenshot is captured, but for dual display, the image is a overlay
>> of one screen on top of the other. Mylyn screenshot works just fine.
>>
>> Is there something wrong in what I'm doing ?
>>
>> -- Ketan
>> http://swtbot.org/ - a functional testing tool for SWT/Eclipse
>
Re: Screenshot api for Mylyn. [message #50726 is a reply to message #50698] Wed, 25 June 2008 02:02 Go to previous messageGo to next message
Eclipse UserFriend
Sorry, I do not know if/how this works on Eclipse 3.3.

Steffen


Ketan Padegaonkar wrote:

> Hi Steffen,
>
> Thanks for your response.
>
> Is there a workaround for this issue ? I'm using eclipse 3.3 and not
> 3.3.x. I could not find a workaround for this, or I'm not looking at the
> right place.
>
> -- Ketan
>
> Steffen Pingel wrote:
>> You might want to take a look at this bug that describes a similar
>> problem that was fixed in Mylyn:
>>
>> 219716: GC.copyArea() does not work for capturing full desktop image if
>> secondary monitor is at left or above the primary monitor
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=219716
>>
>> Steffen
>>
>>
>> Ketan Padegaonkar wrote:
>>
>>> Hi,
>>>
>>> This is slightly off topic.
>>>
>>> I'm looking to capture screenshots for a tool that I'm writing. I've
>>> looked at what mylyn does to capture screenshot and quite like it.
>>>
>>> I'm particularly interested in what ScreenShotCreationPage is doing, but
>>> could not quite reproduce a similar functionality:
>>>
>>
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.mylyn/o rg.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/p rovisional/commons/ui/ScreenshotCreationPage.java?revision=1 .5&root=Tools_Project&view=markup&pathrev=HEAD
>>> This is what I'm doing:
>>>
>>>
>>> protected static boolean captureScreenshot(final String fileName){
>>> GC gc = new GC(display);
>>>
>>> Image image = new Image(display, display.getBounds());
>>> gc.copyArea(image, 0, 0);
>>> gc.dispose();
>>> ImageLoader imageLoader = new ImageLoader();
>>> imageLoader.data = new ImageData[] { image.getImageData() };
>>> imageLoader.save(fileName, SWT.IMAGE_PNG);
>>> }
>>>
>>> The screenshot is captured, but for dual display, the image is a overlay
>>> of one screen on top of the other. Mylyn screenshot works just fine.
>>>
>>> Is there something wrong in what I'm doing ?
>>>
>>> -- Ketan
>>> http://swtbot.org/ - a functional testing tool for SWT/Eclipse
>>
Re: Screenshot api for Mylyn. [message #50754 is a reply to message #50726] Wed, 25 June 2008 09:43 Go to previous message
Eclipse UserFriend
Steffen Pingel wrote:
> Sorry, I do not know if/how this works on Eclipse 3.3.


Thanks, I think I'll just use AWT to capture screenshot :(

-- Ketan
Re: Screenshot api for Mylyn. [message #590294 is a reply to message #50641] Mon, 23 June 2008 19:36 Go to previous message
Eclipse UserFriend
You might want to take a look at this bug that describes a similar problem
that was fixed in Mylyn:

219716: GC.copyArea() does not work for capturing full desktop image if
secondary monitor is at left or above the primary monitor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=219716

Steffen


Ketan Padegaonkar wrote:

> Hi,
>
> This is slightly off topic.
>
> I'm looking to capture screenshots for a tool that I'm writing. I've
> looked at what mylyn does to capture screenshot and quite like it.
>
> I'm particularly interested in what ScreenShotCreationPage is doing, but
> could not quite reproduce a similar functionality:
>
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.mylyn/o rg.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/p rovisional/commons/ui/ScreenshotCreationPage.java?revision=1 .5&root=Tools_Project&view=markup&pathrev=HEAD
>
> This is what I'm doing:
>
>
> protected static boolean captureScreenshot(final String fileName){
> GC gc = new GC(display);
>
> Image image = new Image(display, display.getBounds());
> gc.copyArea(image, 0, 0);
> gc.dispose();
> ImageLoader imageLoader = new ImageLoader();
> imageLoader.data = new ImageData[] { image.getImageData() };
> imageLoader.save(fileName, SWT.IMAGE_PNG);
> }
>
> The screenshot is captured, but for dual display, the image is a overlay
> of one screen on top of the other. Mylyn screenshot works just fine.
>
> Is there something wrong in what I'm doing ?
>
> -- Ketan
> http://swtbot.org/ - a functional testing tool for SWT/Eclipse
Re: Screenshot api for Mylyn. [message #590306 is a reply to message #50670] Tue, 24 June 2008 01:55 Go to previous message
Eclipse UserFriend
Hi Steffen,

Thanks for your response.

Is there a workaround for this issue ? I'm using eclipse 3.3 and not
3.3.x. I could not find a workaround for this, or I'm not looking at the
right place.

-- Ketan

Steffen Pingel wrote:
> You might want to take a look at this bug that describes a similar problem
> that was fixed in Mylyn:
>
> 219716: GC.copyArea() does not work for capturing full desktop image if
> secondary monitor is at left or above the primary monitor
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=219716
>
> Steffen
>
>
> Ketan Padegaonkar wrote:
>
>> Hi,
>>
>> This is slightly off topic.
>>
>> I'm looking to capture screenshots for a tool that I'm writing. I've
>> looked at what mylyn does to capture screenshot and quite like it.
>>
>> I'm particularly interested in what ScreenShotCreationPage is doing, but
>> could not quite reproduce a similar functionality:
>>
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.mylyn/o rg.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/p rovisional/commons/ui/ScreenshotCreationPage.java?revision=1 .5&root=Tools_Project&view=markup&pathrev=HEAD
>> This is what I'm doing:
>>
>>
>> protected static boolean captureScreenshot(final String fileName){
>> GC gc = new GC(display);
>>
>> Image image = new Image(display, display.getBounds());
>> gc.copyArea(image, 0, 0);
>> gc.dispose();
>> ImageLoader imageLoader = new ImageLoader();
>> imageLoader.data = new ImageData[] { image.getImageData() };
>> imageLoader.save(fileName, SWT.IMAGE_PNG);
>> }
>>
>> The screenshot is captured, but for dual display, the image is a overlay
>> of one screen on top of the other. Mylyn screenshot works just fine.
>>
>> Is there something wrong in what I'm doing ?
>>
>> -- Ketan
>> http://swtbot.org/ - a functional testing tool for SWT/Eclipse
>
Re: Screenshot api for Mylyn. [message #590316 is a reply to message #50698] Wed, 25 June 2008 02:02 Go to previous message
Eclipse UserFriend
Sorry, I do not know if/how this works on Eclipse 3.3.

Steffen


Ketan Padegaonkar wrote:

> Hi Steffen,
>
> Thanks for your response.
>
> Is there a workaround for this issue ? I'm using eclipse 3.3 and not
> 3.3.x. I could not find a workaround for this, or I'm not looking at the
> right place.
>
> -- Ketan
>
> Steffen Pingel wrote:
>> You might want to take a look at this bug that describes a similar
>> problem that was fixed in Mylyn:
>>
>> 219716: GC.copyArea() does not work for capturing full desktop image if
>> secondary monitor is at left or above the primary monitor
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=219716
>>
>> Steffen
>>
>>
>> Ketan Padegaonkar wrote:
>>
>>> Hi,
>>>
>>> This is slightly off topic.
>>>
>>> I'm looking to capture screenshots for a tool that I'm writing. I've
>>> looked at what mylyn does to capture screenshot and quite like it.
>>>
>>> I'm particularly interested in what ScreenShotCreationPage is doing, but
>>> could not quite reproduce a similar functionality:
>>>
>>
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.mylyn/o rg.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/p rovisional/commons/ui/ScreenshotCreationPage.java?revision=1 .5&root=Tools_Project&view=markup&pathrev=HEAD
>>> This is what I'm doing:
>>>
>>>
>>> protected static boolean captureScreenshot(final String fileName){
>>> GC gc = new GC(display);
>>>
>>> Image image = new Image(display, display.getBounds());
>>> gc.copyArea(image, 0, 0);
>>> gc.dispose();
>>> ImageLoader imageLoader = new ImageLoader();
>>> imageLoader.data = new ImageData[] { image.getImageData() };
>>> imageLoader.save(fileName, SWT.IMAGE_PNG);
>>> }
>>>
>>> The screenshot is captured, but for dual display, the image is a overlay
>>> of one screen on top of the other. Mylyn screenshot works just fine.
>>>
>>> Is there something wrong in what I'm doing ?
>>>
>>> -- Ketan
>>> http://swtbot.org/ - a functional testing tool for SWT/Eclipse
>>
Re: Screenshot api for Mylyn. [message #590340 is a reply to message #50726] Wed, 25 June 2008 09:43 Go to previous message
Eclipse UserFriend
Steffen Pingel wrote:
> Sorry, I do not know if/how this works on Eclipse 3.3.


Thanks, I think I'll just use AWT to capture screenshot :(

-- Ketan
Previous Topic:Help with Project Explorer
Next Topic:Mylyn 3.0 is available
Goto Forum:
  


Current Time: Thu May 01 05:38:29 EDT 2025

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

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

Back to the top