hi..

i want to save my view as JPG image iam useing folling code

ScalableFreeformRootEditPart rootEditPart = (ScalableFreeformRootEditPart)gViewer.getEditPartRegistry(). get(LayerManager.ID);
IFigure rootFigure = ((LayerManager) rootEditPart).getLayer(LayerConstants.PRINTABLE_LA YERS);
Rectangle rootFigureBounds = rootFigure.getBounds();
Control figureCanvas = gViewer.getControl();
GC figureCanvasGC = new GC(figureCanvas);

Image img = new Image(null, rootFigureBounds.width, rootFigureBounds.height);
GC imageGC = new GC(img);

imageGC.setBackground(figureCanvasGC.getBackground ());
imageGC.setForeground(figureCanvasGC.getForeground ());
imageGC.setFont(figureCanvasGC.getFont());
imageGC.setLineStyle(figureCanvasGC.getLineStyle() );
imageGC.setLineWidth(figureCanvasGC.getLineWidth() );
imageGC.setXORMode(figureCanvasGC.getXORMode());


Graphics imgGraphics = new SWTGraphics(imageGC);
rootFigure.paint(imgGraphics);
ImageData[] imgData = new ImageData[1];
imgData[0] = img.getImageData();
ImageLoader imgLoader = new ImageLoader();
imgLoader.data = imgData;
imgLoader.save("c:/View.jpg", SWT.IMAGE_JPEG);

figureCanvasGC.dispose();
imageGC.dispose();
img.dispose();

my view gViewer contains - x and - y values...
i am able to save the image from (0,0) cordinates can any one tell me the how to get - ve x and y coordinate data

Thanks
Raj