home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "DrawCurveBezier"
- '******************************************************************'
- '* *'
- '* TurboCAD for Windows *'
- '* Copyright (c) 1993 - 2001 *'
- '* International Microcomputer Software, Inc. *'
- '* (IMSI) *'
- '* All rights reserved. *'
- '* *'
- '******************************************************************'
-
- ' Creates curve - Bezier and polygon from coordinates collection
- Public Sub BezierCurve()
- Dim App As Application
- Dim ActDr As Drawing
- Dim Grs As Graphics
- Dim GrBezier As Graphic
- Dim GrPolygon As Graphic
- Dim Ver As Vertex
-
- Set App = IMSIGX.Application
- Set ActDr = App.ActiveDrawing
- Set Grs = ActDr.Graphics
- Dim x#, y#
- Dim x0#, y0#, z0#
- x0 = 1#
- y0 = 5# + 2.5 * Sin(x0)
- z0 = 0#
- ' add two graphics GrBezier and GrPolygon to the graphics collection
- ' coordinates x0,y0,z0 - defines initial point of the graphic
- Set GrBezier = Grs.AddCurveBezier(x0, y0, z0)
- Set GrPolygon = Grs.AddLineIrregularPolygon(x0, y0, 0)
- ' add other points as Vertices to the graphic
- For x = 1 To 9 Step 1
- y = 5 + 2.5 * Sin(x)
- Set Ver = GrBezier.Vertices.Add(x, y, z0)
- Set Ver = GrPolygon.Vertices.Add(x, y, z0)
- Next x
- ' Changes some properties of the graphic
- GrBezier.Properties("PenWidth") = 0.03
- GrBezier.Properties("PenColor") = RGB(255, 0, 0)
- GrBezier.Properties("PenStyle") = "Dashed"
- GrBezier.Draw
-
- GrPolygon.Properties("PenWidth") = 0.03
- GrPolygon.Properties("PenColor") = RGB(0, 255, 0)
- GrPolygon.Draw
-
- End Sub
-