新聞中心

        EEPW首頁 > 嵌入式系統 > 設計應用 > 移植VB維護程序到mobile下

        移植VB維護程序到mobile下

        作者: 時間:2016-10-08 來源:網絡 收藏

        Dim angleIncrement As Single

        angleIncrement = (sweepAngle - startAngle) / 10

        Dim angle As Single

        angle = startAngle

        Dim i As Integer

        For i = 0 To 10

        xAngle(i) = x + (Math.Cos(angle * (Math.PI / 180)) * (width / 2))

        yAngle(i) = y + (Math.Sin(angle * (Math.PI / 180)) * (height / 2))

        angle += angleIncrement

        Next i

        xAngle(11) = x + (Math.Cos(sweepAngle * (Math.PI / 180)) * (width / 2))

        yAngle(11) = y + (Math.Sin(sweepAngle * (Math.PI / 180)) * (height / 2))

        Dim anglePoints(12) As Point

        anglePoints(0) = New Point(x, y)

        For i = 0 To 11

        anglePoints(i + 1) = New Point(CInt(xAngle(i)), CInt(yAngle(i)))

        Next

        graphicsObject.DrawPolygon(pen, anglePoints)

        End Sub

        '=====================================================

        '填充弧形

        ' graphicsObject - Graphics 對象

        ' solidBrush - 畫刷

        ' x,y - 弧的圓心

        ' width - 寬度 (X直徑)

        ' height - 高度 (Y直徑)

        ' startAngle - 起始角度

        ' sweepAngle - 結束角度

        '

        Sub fillPie(ByVal graphicsObject As Graphics, ByVal solidBrush As SolidBrush, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal startAngle As Single, ByVal sweepAngle As Single)

        Dim xAngle(12) As Single

        Dim yAngle(12) As Single

        Dim angleIncrement As Single

        angleIncrement = (sweepAngle - startAngle) / 10

        Dim angle As Single

        angle = startAngle

        Dim i As Integer

        For i = 0 To 10

        xAngle(i) = x + (Math.Cos(angle * (Math.PI / 180)) * (width / 2))

        yAngle(i) = y + (Math.Sin(angle * (Math.PI / 180)) * (height / 2))

        angle += angleIncrement

        Next i

        xAngle(11) = x + (Math.Cos(sweepAngle * (Math.PI / 180)) * (width / 2))

        yAngle(11) = y + (Math.Sin(sweepAngle * (Math.PI / 180)) * (height / 2))

        Dim anglePoints(12) As Point

        anglePoints(0) = New Point(x, y)

        For i = 0 To 11

        anglePoints(i + 1) = New Point(CInt(xAngle(i)), CInt(yAngle(i)))

        Next

        graphicsObject.FillPolygon(solidBrush, anglePoints)

        End Sub


        上一頁 1 2 3 下一頁

        關鍵詞:

        評論


        相關推薦

        技術專區

        關閉
        主站蜘蛛池模板: 万盛区| 凤山县| 永丰县| 德阳市| 东兴市| 张家口市| 乌海市| 华亭县| 兰西县| 巴南区| 张家川| 突泉县| 娄烦县| 尚义县| 股票| 陇南市| 福泉市| 拜城县| 庄浪县| 嘉鱼县| 绥芬河市| 榆树市| 陆良县| 凤凰县| 五原县| 雷山县| 瑞安市| 红河县| 尤溪县| 加查县| 无锡市| 中山市| 阜城县| 永丰县| 左贡县| 星座| 客服| 南陵县| 新干县| 定南县| 蒙阴县|