Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Sirius - Capture screenshot programmatically(Sirius - Capture screenshot programmatically)
Sirius - Capture screenshot programmatically [message #1425657] Wed, 17 September 2014 16:39 Go to next message
VVasanth Kumar is currently offline VVasanth KumarFriend
Messages: 13
Registered: July 2012
Junior Member
Hi,

In one of the forum post, I found the reference about how to create sirius diagram programmatically.

Could you please let me know is it possible to take the screenshot of the diagram programmatically?

My requirement is, I would like to capture the image of the model without opening the diagram physically. Could you please help me by pointing to the right resource?
Re: Sirius - Capture screenshot programmatically [message #1425664 is a reply to message #1425657] Wed, 17 September 2014 16:50 Go to previous message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hello,

DialectUIManager provides an API to export representations as an image.

Here is a quick sample that export the first representation of a session
in a project:

Collection<DRepresentation> allRepresentations =
DialectManager.INSTANCE.getAllRepresentations(session);
DRepresentation representation = (DRepresentation)
allRepresentations.toArray()[0];

IPath absoluteImagePath =
ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME).getLocation().append(IMAGE_FILE_NAME);

// Export the image
DialectUIManager.INSTANCE.export(representation, session,
absoluteImagePath, new ExportFormat(ExportDocumentFormat.NONE,
ImageFileFormat.PNG), new NullProgressMonitor());

Regards,
Steve

Le 17/09/2014 18:39, VVasanth Kumar a écrit :
> Hi,
>
> In one of the forum post, I found the reference about how to create
> sirius diagram programmatically.
>
> Could you please let me know is it possible to take the screenshot of
> the diagram programmatically?
>
> My requirement is, I would like to capture the image of the model
> without opening the diagram physically. Could you please help me by
> pointing to the right resource?


--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:master detail tables
Next Topic:get the name of the file storing a model
Goto Forum:
  


Current Time: Fri Sep 20 17:00:48 GMT 2024

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

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

Back to the top