Is it possible to highlight a Picture?

Hi walter,

I have a link which consist a picture(Plus sign Image) on it like below:-

Whenever i hover on link, whole link get highlighted except the picture(Plus sign Image) on it.
My linkTemplate is:
mainDiagram.linkTemplate =
routing: go.Link.AvoidsNodes,
curve: go.Link.JumpOver,
corner: 5,
toShortLength: 4,
selectable: false,
layoutConditions: go.Part.LayoutAdded | go.Part.LayoutRemoved,
// links cannot be selected, so they cannot be deleted
// If a node from the pallette is dragged over this node, its outline will turn green
mouseDragEnter: function(e, link) { link.isHighlighted = true;
diagramCopy.findLayer(“Tool”).opacity = 0.3; },
mouseDragLeave: function(e, link) { link.isHighlighted = false;
diagramCopy.findLayer(“Tool”).opacity = 1;},
// if a node from the Palette is dropped on a link, the link is replaced by links to and from the new node
mouseDrop: dropOntoLink
$go(go.Shape, linkShapeStyle()),
{ toArrow: “standard”, stroke: null, fill: “Grey” })

Is there any way to highlight the picture(plus sign image) as well along with link?

Please read GoJS Highlighting -- Northwoods Software. Basically there is no built-in implementation for highlighting any Node or Link – you have to define how to render the highlighting in your template.

Apparently that is already defined in your linkShapeStyle function, although you did not post that code. You need to do something similar for your Picture.

Yes walter, i did the same thing for picture also, but picture doesn’t have stroke property for highlighting the image. Therefore i got stuck. Could you please suggest any way?

That depends on your image. If it’s partly translucent, you could just bind the Picture.background. Or you could put the Picture inside a Panel and bind the Panel’s background. Or put the Picture inside an Auto Panel and bind some property of the main element. There are so many possibilities – it depends on how you want to show highlighting in your app. (That’s why there’s no pre-defined implementation for highlighting.)