VBA代码转换为C#代码

DimarrayPoints(1To7,1To2)AsSinglearrayPoints(1,1)=sourceXarrayPoints(1,2)=sourceYarra... 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)
Set myLine = myDoc.Shapes.AddCurve(arrayPoints, myAnchor)
就是这局不会呀
展开
 我来答
hl233211
2016-08-30 · TA获得超过606个赞
知道小有建树答主
回答量:421
采纳率:0%
帮助的人:386万
展开全部
代码不全啊 很难理解
// float和Single小数点位数也有点对不上
float arrayPoints = new float[7][2];
arrayPoints [0][0] = sourceX;
arrayPoints[0][1] = SourceY;
arrayPoints[1][0] = sourceX;
arrayPoints[1][1] = SourceY;
arrayPoints[1][1] = SourceY;
arrayPoints[2][0] = nodeX - (targetX - sourceX)/4;
arrayPoints[2][1] = nodeY - (targetY - sourceY) / 4
arrayPoints[3][0] = nodeX ;
arrayPoints[3][1] = nodeY ;
arrayPoints[4][0] = nodeX + (targetX - sourceX) / 4 ;
arrayPoints[4][1] = nodeY + (targetY - sourceY) / 4 ;
arrayPoints[5][0] = targetX ;
arrayPoints[5][1] = targetY ;
arrayPoints[6][0] = targetX ;
arrayPoints[6][1] = targetY ;
// 最后一句话像是画图形?画线段?对应的C#好像没见过这方法
但是有个G.DrawRectangle()方法。 不知道能不能对应上。
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式