Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Insert an image in a diagram node
Insert an image in a diagram node [message #967249] Thu, 01 November 2012 16:06 Go to next message
Hristina Pavlovska is currently offline Hristina PavlovskaFriend
Messages: 4
Registered: October 2012
Junior Member
Hi all,

I want to insert an .png image in a diagram node (no SVG). Has anyone experience to share on the subject?

What I did till now is:
- Created Figure descriptor in .gmfgraph by adding Rectangle->CustomFigure.
- Did the following changes in my XXEditPart code:

Image img = new Image(Display.getDefault(),"path_to_my_img");

ImageFigure imgF = new ImageFigure();

// Add it to the figure

// Set figure size as picture size


But no image appears on the diagram.

I'm looking forward to hear any suggestion.

Re: Insert an image in a diagram node [message #972190 is a reply to message #967249] Mon, 05 November 2012 12:33 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi Hristina,

you could try to embed the png picture into an SVG file and use GMFGraph Model's capabilities for doing your job without any coding. This will save you the effort to customize the code generation templates in the end. What is the reason for insisting on PNG? If you use SVG figures your diagram will look much nicer in the end.

Previous Topic:Access GMF Diagram Elements and Attributes/Properties
Next Topic:GMF Mindmap Example & Broken Links
Goto Forum:

Current Time: Tue Oct 27 22:10:34 GMT 2020

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

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

Back to the top