中易网

VBA代码转换为C#代码

答案:2  悬赏:20  
解决时间 2021-03-11 21:44
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)
就是这局不会呀
最佳答案
代码不全啊 很难理解
// 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()方法。 不知道能不能对应上。
全部回答
public object drawdot(double x1,double y1 ,double r ) { bool dialogdisplay, drawflag; double tempx, tempy, tempr; tempx = ox + (x1 * 10) ; tempy = oy - (y1 * 10) ; tempr = r * 10; dialogdisplay = false; if((tempx - tempr < ox - lx / 2) || (tempx + tempr > ox + lx / 2) || (tempy - tempr < oy - ly / 2) || (tempy + tempr > oy + ly / 2)) { dialogdisplay = true ; messagebox.show("超出了边界!", "提示", messageboxbuttons.yesno, messageboxicon.information); drawflag = false; return ; } //不知道你用的是什么? //set drawdot = activedocument.shapes.addshape(msoshapeoval, tempx - tempr, tempy - tempr, 2 * tempr, 2 * tempr) //drawdot.fill.forecolor = rgb(0, 0, 0) //drawflag = true }
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
紧字的部首是什么,再查多少画
显卡插入主板后,显卡风扇可以转,GPU也会发
苏州蓬思莱彩妆学校和首艾彩妆学校哪个好点
石柱土家族自治县渝中实验小学校我想知道这个
望江县鸦滩镇好声音主题量贩式KTV我想知道这
怎么查看qq lp登录
求用C语言写密码学中的S盒
农贸市场卖什么赚钱
大学生简历含大三的工作情况
双鱼座的配偶是啥座?
电脑升级win10后打印机无法使用
妈妈买了苹果和香蕉各l千克,共付42元,香蕉
中国石油惠农园艺镇加油站在哪里啊,我有事要
判断题要怎么复习啊,所谓的倒扣分,是不是20
安徽省宁国市朝农化工有限责任公司 这家公司
推荐资讯
广州九凤电子商务有限公司对员工的待遇怎样?
如何优雅的犯贱?
我是内蒙全覆盖工程打路面的现场管理人员。在
一品酒坊这个地址在什么地方,我要处理点事
落花无情的下一句是什么
为什么活的好憋屈
七夕要发红包给女朋友说点什么呢?
中国那里有5千吨至1万吨位的平板开口船出租?
已知等差数列 {an}的前5项和S5=25,a8=15,速
p打头的单词
太白森林终南派出所地址好找么,我有些事要过
lol代练用什么软件有朋友有吗免费的最好
手机登qq时,显示手机磁盘不足,清理后重新登
刺客的套装怎么选啊?