[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: Creating an Image

Seems easy enough.  The problem that I seem to be having is how to get a handle to the figure that I want to paint.  I want to have an action that will save off an image.  The action extends EditorPartAction and will be created on my Editor.  My editor has a handle to the model class only.   When getGraphicalViewer().setContents(model) is called is when the part corresponding to the model, and hence the figure is created (via my part factory).  There does not seem to be a way to get the Part from within the action or the editor.

How is this accomplished?

Thanks again,
Phil

Randy Hudson wrote:
Image image = new Image(null, width, height);
GC gc = new GC(image);
SWTGraphics g = new SWTGraphics(gc);
figure.paint(g);

"Phil Williams" <phil.williams@xxxxxxxxxxxx> wrote in message
news:c787he$4t8$1@xxxxxxxxxxx...
  
I asked this in the past, but have gotten no responses, so let me
    
rephrase:
  
I would like to be able to create an action that can capture the diagram
in a GEF editor to an image file (JPG, PNG, BMP, whatever).  I am at a
loss as to how to start.

Does anyone out there have any pointers or sample code to help me get
started?

Thanks in advance,
Phil