adding images on-click

Started by dubbya.wow, April 18, 2014, 06:14:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dubbya.wow

Hello,

I've been using Visio to design network infrastructure documents for a few years, but now I have been tasked with a project to show additional "real world" info upon a click, hover, opening shape data, etc.  What I would like to do is: be able to view a picture (taken with a camera) when I click on a certain object within my visio topology. 

As far as I've been able to read online, there is no such utility, but it would seem to me that I am also not the first person to think that this would be useful.

In case I was not clear enough above, Ill spell out a small example of what I'm talking about:

[CISCO6509E]-------[CISCO3750X]---------[CISCO7206VXR]  - if I were to click on the visio shape for a router representing the 7206VXR, I want a popup, hover, or some other action to then display an actual image of the device (that I took previously).

Is there a way to do this?  If not, are there any other diagramming tools that this community knows can perform this action?  I know I am new to these forums, but I would very much appreciate a response and please let me know if I have posted this question in the wrong forum.  Have a great day.

Dubbya.wow

Yacine

Hi Bob,
what you request is certainly feasable, but it will require some deeper coding.
You may also want to ask yourself, for which audience you plan to implement this feature.
If it's a web page, then some javascript to pop up an image would be better. This solution would unfortunately also require coding.
Yacine

wapperdude

This can be done in shapesheet, dbl click event.

Convert your shape to group.  Note ID number.  Open group shapesheet. 
  > insert User.Defined section. 
  > Rename row for convenience, e.g., user.DblOn
  > Set value to False

Scroll down to Event Section.  In the double click cell, enter formula:  IF(User.DblOn,SETF(GetRef(User.DblOn),"false"),SETF(GetRef(User.DblOn),"true"))

Scroll back up to Protection Section, and set LockCalcWH=1

Close shapesheet.  Select the picture and add to group shape. Open its shapesheet.

Scroll down to Image Properties section, and in the transparency cell, enter formula:  IF(Sheet.1!User.DblOn,0,100)%, where Sheet.1 will be your group shape ID.

Close shapesheet.

Double clicking the group shape will toggle the user.DblOn cell between true and false.  The picture shapesheet will grab this value and set the transparency to 0% showing the image or 100% hiding the image.  Locking the CalcWH cell prevents the resizing of the alignment box for the group shape.  This has to be set before adding the picture to the group, otherwise, the alignment box will bound both the main shape plus the picture.

HTH
Wapperdude
Visio 2019 Pro

dubbya.wow

Hello All,

Thank you so much for the replies.  I feel better knowing there is an actual way to do this.  I had a bit of trouble implementing the code WrapperDude mentioned below.  I had an issue with the formula "IF(Sheet.1!User.DblOn,0,100)%" (I tried it with and without the %).  Is there some other way I should be entering this value?  Does "Sheet1" reference the page it is on or is that some other value?

Thanks again

dubbya.wow

My mistake... I misread.  I am still having trouble when I replace Sheet1 with my shape ID.

wapperdude

#5
 ...and my mistake too!   ::)

I forgot that when you insert picture, there's a new section called Foreign Image Info.  The transparency cell of the Image Properties section will not do anything.

What needs to be done is to squeeze the picture size to zero when you want to hide it.   So, select the image and open its shapesheet.  Then:

1.)  Reset the Image Properties > Transparency back to original 0%.
2.)  Now go to the Foreign Image Info section and modify the following cell by entering the formula as shown:
    ImgWidth: =IF(Sheet.1!User.DblOn,Width*1,0)
 
.   As before, sheet.1 would be your group shape, e.g., sheet.867 or however it is named.

That should do it.  Sorry for the misinformation and confusion.

I've attached a Visio file what has a simple example.
Wapperdude
Visio 2019 Pro

dubbya.wow

You are the best WrapperDude.  Thanks for all your help.

dubbya.wow

Another request if you happen to know the answer, Is there a way to create a button that hides all images that have been displayed by the double click?  I've created a document with multiple images available on double click, but removing them requires you double click the appropriate container again.  Is there a way to hide them all with one action?

Thanks again.  This project is beginning to shape up because of you guys.

Yacine

Still not sure, if that should be the way to go.
Usually users don't take the time to shrink images and they add whatever image they find.
Furthermore, drawings often grow over the initially planed purpose.
These two reasons, will imply that images should be loaded dynamically.
And if you keep this thought, you will sooner or later recall that web pages do this job much better than Visio.
Thus the legitime question: what is the audience of this document? and what software is available to it?
Yacine

wapperdude

#9
This is doable.  The easiest approach would be to use layers.  You could assign all of your pictures to be on a specific layer, e.g., images.  Then, you can toggle the visibility of the image layer.  Don't know if that's easily accessible, like with a double-click, or something, as I rarely use layers.  You might find something that applies by searching this forum.

Wapperdude

PS:  Yacine has a reply in the following post about toggling layers:  http://visguy.com/vgforum/index.php?topic=5537.msg22076#msg22076She He also has a couple of good links included in her his reply.
Visio 2019 Pro

dubbya.wow

Thank you.  Audience is technical users (NOC, engineers), purpose is fast troubleshooting

wapperdude

Since I already had the file created, I augmented it to include:
    1.  Right click any open space on the drawing page to bring up context window.  Window has a toggle image on/off entry.
    2.  Added an on/off button to the page.  Double click the button to toggle the images on/off.

Both of these entries toggle the visibility of an "image" layer to which each picture has been assigned.  Thus, these are "global" on/offs.  Double clicking an individual shape still works, but only applies to the image of that shape.  Because, this feature is implemented independent of the layers, it has precedence over the layers. 

HTH
Wapperdude
Visio 2019 Pro

Yacine

#12
Quote from: wapperdude on April 21, 2014, 09:04:34 PM
Wapperdude

PS: ... She also has a couple of good links included in her reply.

LOL. I feel flattered. I always wondered why you were so neat to me.  ;)

https://www.google.de/search?q=Yacine&num=30&newwindow=1&safe=off&client=firefox-a&hs=SX0&rls=org.mozilla:de:official&channel=sb&source=lnms&tbm=isch&sa=X&ei=0aFWU_aZI9SFyQP0x4CIBA&ved=0CAgQ_AUoAQ&biw=1565&bih=778

But I don't mind, even the german army invited me several years ago as Miss Yacine to a recruitement examination! After a while you get accustomed.

Actually I work a lot with international partners. Specially in the asian region, I often don't know the gender of my contact. So the easiest is to google images of the name.
Yacine

wapperdude

@Yacine...really embarrassed... ::)  When you first joined the forum, that was my 1st impression.  But, soon realized, that you were "he" not "she".  Guess, I instinctively reverted back to 1st impression.  My apologies.  As far as being "neat", I try not to show favorites, but, I do like what you post.  Most every contributor provides thoughtful, creative responses, and tries to avoid stepping on each other.  That's what makes the this forum so great.  Now, to go and hide.   8)
Visio 2019 Pro

Yacine

Thanks for the flowers and no need for hiding. I do apologize for correcting you.
And I agree with you that the politeness in this forum is exceptional. It's the reason why I spend so much time here.
Yacine