ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

【CorelDraw VBA 003例】 利用虚拟图形创建形状

2021-11-24 09:02:32  阅读:165  来源: 互联网

标签:Dim VBA Set crv Double Curve 003 arrPoints CorelDraw


Sub CreateMyVirtualCurve()
    '##利用虚拟图形创建形状
    Dim s As Shape, crv As Curve
    Dim x As Double, y As Double
    Dim arrPoints(9, 1) As Double
    arrPoints(0, 0) = 162.4175222: arrPoints(0, 1) = 0.750376435
    arrPoints(1, 0) = 162.1904178: arrPoints(1, 1) = 1.42190801
    arrPoints(2, 0) = 161.8497645: arrPoints(2, 1) = 1.948110991
    arrPoints(3, 0) = 161.4460634: arrPoints(3, 1) = 2.285272734
    arrPoints(4, 0) = 161.0384773: arrPoints(4, 1) = 2.41926736
    arrPoints(5, 0) = 160.6855104: arrPoints(5, 1) = 2.367701481
    arrPoints(6, 0) = 160.4357975: arrPoints(6, 1) = 2.177051589
    arrPoints(7, 0) = 160.3204565: arrPoints(7, 1) = 1.915245416
    arrPoints(8, 0) = 160.3482122: arrPoints(8, 1) = 1.66085887
    arrPoints(9, 0) = 160.5040603: arrPoints(9, 1) = 1.490634456
    x = arrPoints(0, 0)
    y = arrPoints(0, 1)
    Set crv = New Curve 'Create our curve in Memory
    Set sp = crv.CreateSubPath(x, y)
    For i = 1 To 9
        x = arrPoints(i, 0)
        y = arrPoints(i, 1)
        sp.AppendCurveSegment x, y
    Next i
    sp.Closed = False
    'Take our curve in memory and create a virtual shape
    Set s = ActiveVirtualLayer.CreateCurve(crv)
    'Smooth all the nodes
    s.Curve.Nodes.All.SetType cdrSmoothNode
    'Log the newly created virual shape
    ActiveDocument.LogCreateShape s
End Sub

  

标签:Dim,VBA,Set,crv,Double,Curve,003,arrPoints,CorelDraw
来源: https://www.cnblogs.com/ExcelSoSo/p/15596570.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有