Using AddCurve() to add a bezier curve from VB.NET

M

Michel Reij

I'm currently translating a piece of code from an old VB6 application
to VB.NET. It is generating a Word document, containing some graphics.

Parts of it are using the AddCurve(SafeArrayOfPoints, Anchor) method to
insert a bezier curve.

In VB6 I could create a SafeArrayOfPoints by doing this:

Dim arrayPoints(1 To 7, 1 To 2) As Single

arrayPoints(1, 1) = sourceX
arrayPoints(1, 2) = sourceY
arrayPoints(2, 1) = sourceX
arrayPoints(2, 2) = sourceY

arrayPoints(3, 1) = nodeX - (targetX - sourceX) / 4
arrayPoints(3, 2) = nodeY - (targetY - sourceY) / 4
arrayPoints(4, 1) = nodeX
arrayPoints(4, 2) = nodeY
arrayPoints(5, 1) = nodeX + (targetX - sourceX) / 4
arrayPoints(5, 2) = nodeY + (targetY - sourceY) / 4

arrayPoints(6, 1) = targetX
arrayPoints(6, 2) = targetY
arrayPoints(7, 1) = targetX
arrayPoints(7, 2) = targetY

Set myLine = myDoc.Shapes.AddCurve(arrayPoints, myAnchor)


But VB.NET doesn't allow me set the lowerbound on the array created
this way.

Can anyone help me tackle this one?


Michel Reij
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top