|
Re: Sirius - Capture screenshot programmatically [message #1425664 is a reply to message #1425657] |
Wed, 17 September 2014 16:50 |
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03245 seconds