|
|
Re: Capture Screen Shot of WorkSpace [message #787644 is a reply to message #787605] |
Tue, 31 January 2012 20:43   |
Eclipse User |
|
|
|
It sounds like what you are interested in is taking a screenshot of the RAP application itself. If that is the case, it simply is not possible in a web browser. Here is a good discussion over at StackOverflow[1]. Since RAP runs as HTML and Javascript in the browser, the discussion applies to RAP as well.
[1] http://stackoverflow.com/questions/1794719/capture-screenshot-of-website-on-the-client-javascript-or-flash
Cole
|
|
|
Re: Capture Screen Shot of WorkSpace [message #787648 is a reply to message #787605] |
Tue, 31 January 2012 20:44   |
Eclipse User |
|
|
|
It sounds like what you are interested in is taking a screenshot of the RAP application itself. If that is the case, it simply is not possible in a web browser. Here is a good discussion over at StackOverflow[1]. Since RAP runs as HTML and Javascript in the browser, the discussion applies to RAP as well.
[1] http://stackoverflow.com/questions/1794719/capture-screenshot-of-website-on-the-client-javascript-or-flash
Cole
|
|
|
Re: Capture Screen Shot of WorkSpace [message #787685 is a reply to message #787648] |
Tue, 31 January 2012 21:41   |
Eclipse User |
|
|
|
Hi Cole
I do not want to do in the browser.
I want to do sometihg like
// Take the snapshot into a display Image. This works very well in SWT.
Point size = myWidget.getSize();
Image image = new Image(display, size.x, size.y);
GC gc = new GC(myWidget);
gc.copyArea(image, 0, 0);
gc.dispose();
but in RAP, we do not have copyArea function.So what is the work around. I know i need to create the image like
private BufferedImage createImage() {
BufferedImage image = new BufferedImage( 200, 200, BufferedImage.TYPE_INT_ARGB );
Graphics2D gr2d = image.createGraphics();
// draw the image
gr2d.setColor( new Color( 0, 0, 255 ) );
gr2d.drawRect( 0, 0, widht - 1, height - 1 );
...
return image;
}
but how to draw the widgets on the image using gr2d???
I will appreciate for some pointers.
Thanks
Raj
|
|
|
Re: Capture Screen Shot of WorkSpace [message #787688 is a reply to message #787648] |
Tue, 31 January 2012 21:41   |
Eclipse User |
|
|
|
Hi Cole
I do not want to do in the browser.
I want to do sometihg like
// Take the snapshot into a display Image. This works very well in SWT.
Point size = myWidget.getSize();
Image image = new Image(display, size.x, size.y);
GC gc = new GC(myWidget);
gc.copyArea(image, 0, 0);
gc.dispose();
but in RAP, we do not have copyArea function.So what is the work around. I know i need to create the image like
private BufferedImage createImage() {
BufferedImage image = new BufferedImage( 200, 200, BufferedImage.TYPE_INT_ARGB );
Graphics2D gr2d = image.createGraphics();
// draw the image
gr2d.setColor( new Color( 0, 0, 255 ) );
gr2d.drawRect( 0, 0, widht - 1, height - 1 );
...
return image;
}
but how to draw the widgets on the image using gr2d???
I will appreciate for some pointers.
Thanks
Raj
|
|
|
|
Re: Capture Screen Shot of WorkSpace [message #789240 is a reply to message #787702] |
Thu, 02 February 2012 19:22   |
Eclipse User |
|
|
|
Hi Cole
I am thinking
1. we can pass the complete html from client to server
2. in the server using the swing(javax.swing.JEditorPane) we can create the image
javax.swing.JEditorPane().setText(<text form client>) ;
BufferedImage img = new BufferedImage(prefSize.width, editorPane.getPreferredSize().height, BufferedImage.TYPE_INT_ARGB);
Graphics graphics = img.getGraphics();
editorPane.paint(graphics);
return img;
Now how to get the complete html(view and other stuff on browser) text being displayed on client and send it to server.
|
|
|
Re: Capture Screen Shot of WorkSpace [message #789244 is a reply to message #787702] |
Thu, 02 February 2012 19:22   |
Eclipse User |
|
|
|
Hi Cole
I am thinking
1. we can pass the complete html from client to server
2. in the server using the swing(javax.swing.JEditorPane) we can create the image
javax.swing.JEditorPane().setText(<text form client>) ;
BufferedImage img = new BufferedImage(prefSize.width, editorPane.getPreferredSize().height, BufferedImage.TYPE_INT_ARGB);
Graphics graphics = img.getGraphics();
editorPane.paint(graphics);
return img;
Now how to get the complete html(view and other stuff on browser) text being displayed on client and send it to server.
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05912 seconds