Drawing a shape on a image

Z

ZyRaIN

Hi Guys,

Got a new problem, I've extracted som informations about my shapes in a
document, now I want to draw a new shape on an image based on the
information that I've got.. (x,y,height,width) on a shape.

How do I do this - plz make it simple - noob to visio development.

Programming in vb.net

/ZyRaIN
 
C

Chris [Visio MVP]

The Visio 2003 SDK has lots of examples and help, and will help get you
going:

http://www.microsoft.com/downloads/...BD-B0BB-46E7-936A-B8539898D44D&displaylang=en


And I've got some more here:

http://www.wanderkind.com/visio/VisLinks.htm


I'm not sure if you want to draw geometry on the image or just drop master
shapes onto it.

You can immediately do code in VBA (Alt + F11 to get the editor), hopefully
you've found that...

Some snippets:

dim mst as Visio.Master
set mst = Visio.ActiveDocument.Masters("Some Master")

dim shpImage as Visio.Master

' Get shpImage somehow...
set shpImage = Visio.ActiveWindow.Selection.Item(1) '...ie the first
selected shape

'Drop a shape on top of shpImage:
dim shpOnTop as Visio.Shape
dim x as double, y as double

x = shpImage.Cells("PinX").ResultIU
y = shpImage.Cells("PinY").ResultIU

set shpOnTop = Visio.ActivePage.Drop( mst, x, y )

Maybe this will get you started.

There is also Developer Help that can be installed with normal Visio, but
it's a bit hard to use. You will have direct access from VBA to this help
file, though, so that's handy at least. You can highlight an object in code
and press F1 and jump right to the dev help!
 
Top