![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jul 2012
Location: New York
Posts: 7
![]() |
I had to change from WorldWindowGLCanvas to WorldWindowGLJPanel due to multiple reasons, but now when I take a screenshot there is a black box above the image.
Code:
private class ScreenshotRunnable implements Runnable, IBufferedImageProvider
{
BufferedImage myImage = null;
int width;
int height;
@Override
public void run()
{
// create a screenshot image of the WorldWind context
GLContext context = WORLD_WINDOW.getContext();
width = context.getGLDrawable().getWidth();
height = context.getGLDrawable().getHeight();
if (width > 0 && height > 0)
{
context.makeCurrent();
myImage = com.sun.opengl.util.Screenshot.readToBufferedImage(width, height);
context.release();
}
}
@Override
public BufferedImage getBufferedImage() throws ReportException
{
return myImage;
}
|
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Jul 2012
Location: New York
Posts: 7
![]() |
Nevermind, I figured it out on my own!! I followed advice from this site:
http://issues.worldwind.arc.nasa.gov...browse/WWJ-275 Turns out I needed to use View to get the height and width, rather than GLContext. |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to put WorldWindowGLJPanel in JPanel | tmkd | WorldWind General | 1 | 12-08-2010 06:11 PM |
| Centering the globe in a WorldWindowGLJPanel | nigel25840 | Development Help | 1 | 01-13-2009 09:24 PM |
| WorldWindowGLJPanel and GlobeAnnotation | shawngano | Development Help | 2 | 12-15-2007 07:42 PM |
| About WorldWindowGLJPanel | asantiago | Development Help | 6 | 11-06-2007 06:55 PM |
| WW refuses to work correctly | ups | Technical Support | 19 | 10-22-2004 04:57 AM |