Skip to main content



      Home
Home » Eclipse Projects » Sirius » Sirius - Capture screenshot programmatically(Sirius - Capture screenshot programmatically)
Sirius - Capture screenshot programmatically [message #1425657] Wed, 17 September 2014 12:39 Go to next message
Eclipse UserFriend
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 12:50 Go to previous message
Eclipse UserFriend
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
Previous Topic:master detail tables
Next Topic:get the name of the file storing a model
Goto Forum:
  


Current Time: Mon Jun 09 08:41:52 EDT 2025

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

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

Back to the top