Drop an image inside a shape

Started by sureshkumargundala, April 30, 2013, 12:29:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sureshkumargundala

Hi,

I have a requirement where I need to drop an image inside the vacant space(say a rectangle box) of a visio shape.
kindly help me in achieving this functionality. I have also attached a file stating my requirements
Thanks in advance.

Regards
Suresh Kumar Gundala

aledlund

You're going to have to provide custom code (rough outline)
..event handler to recognize the dropped shape
..recognize if it is an image
..spot if their is an appropriate target shape in the neighborhood
..resize the image to fit in the target (and any other manipulations)
..create a group for the target (if needed)
..add the image to target group

al

sureshkumargundala

Hi al,

Thanks for your reply.
Do i need to write a c# code or VBA code to achieve this?

Thanks
Suresh Kumar Gundala

aledlund

you can write it in either. C# of course requires a compiler (visual studio?) and vba can be done internally in visio. There is a lot of valuable example/demo software in the visio sdk, which supports both languages.
al

sureshkumargundala

Hi Al,

Iam very new to this kind of development. Can you please post some code to being.
Thanks in advance

Regards
Suresh Kumar Gundala

Nikolay

Maybe you could share with us why you need this functionality?

If this is some sort of organization chart,
Visio has a special nice built-in feature to deal with that.

Paul Herber

Hi Suresh, the SDK really is the best place to start.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

sureshkumargundala

Hi Nikolay,

We have to create a set of shapes like the one which I have posted. This is one of the example I have posted. The idea is to create shapes like the ones in balsamiq.

Thanks
Suresh Kumar Gundala

Nikolay

Hi Suresh,

Then you'd better go with what al and Paul are suggesting..
VisioSDK is readlly a great place to start and it has lots of code samples!

FYI, you can always use Visio macro recorder - a nice Visio function which generates VBA code as you are doing the actions using UI.
So you can "start recording" the code, then import that image by hand, "sop recording", and you get the VBA code.

Paul Herber

Suresh, another thing to look at is containers (Visio 2010 onwards). These may have all the functionality you need.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/