CurveToBezier example for Visual Basic
Private Declare Function PolyBezier Lib "gdi32" (ByVal hdc As Long, lppt As POINTAPI, ByVal cPoints As Long) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Sub Bezier_Click()
LEADRasterView1.Raster.CurveClose = CURVE_CLOSE
LEADRasterView1.Raster.CurveSize = 4
LEADRasterView1.Raster.CurveX(1) = 10
LEADRasterView1.Raster.CurveY(1) = 30
LEADRasterView1.Raster.CurveX(2) = 20
LEADRasterView1.Raster.CurveY(2) = 240
LEADRasterView1.Raster.CurveX(3) = 250
LEADRasterView1.Raster.CurveY(3) = 260
LEADRasterView1.Raster.CurveX(0) = 220
LEADRasterView1.Raster.CurveY(0) = 10
LEADRasterView1.Raster.CurveTension = 0.35
LEADRasterView1.Raster.CurveType = CURVE_STANDAR
LEADRasterView1.Raster.SetRgnCurve L_POLY_WINDING, L_RGN_SET
LEADRasterView1.RgnFrameType = RGNFRAME_ANIMATED
LEADRasterView1.Raster.CurveToBezier
ReDim p(LEADRasterView1.Raster.BezierSize) As POINTAPI
Dim i
For i = 1 To LEADRasterView1.Raster.BezierSize
p(i).x = LEADRasterView1.Raster.BezierX(i - 1)
p(i).y = LEADRasterView1.Raster.BezierY(i - 1)
Next
PolyBezier Form1.hdc, p(1), LEADRasterView1.Raster.BezierSize
End Sub