RT

解决方案 »

  1.   


        定义合适的字体、前景色,然后:    picture1.print "★"
      

  2.   

    Option ExplicitPrivate Sub Command1_Click()
        Dim Point(0 To 10) As POINTAPI
            
        Point(0).x = 0: Point(0).y = 50
        Point(1).x = 100: Point(1).y = 50
        Point(2).x = 33: Point(2).y = 100
        Point(3).x = 50: Point(3).y = 0
        Point(4).x = 66: Point(4).y = 100
        
        Polygon Me.hdc, Point(0), 5
    End SubPrivate Sub Command2_Click()
        Dim Point(0 To 10) As POINTAPI
            
        Point(0).x = 0: Point(0).y = 50
        Point(1).x = 100: Point(1).y = 50
        Point(2).x = 33: Point(2).y = 100
        Point(3).x = 50: Point(3).y = 0
        Point(4).x = 66: Point(4).y = 100
        
        Polygon Picture1.hdc, Point(0), 5
    End Sub'===============
    下面的程序在模块中
    '==============Option ExplicitType POINTAPI
        x As Long
        y As Long
    End TypeDeclare Function Polygon Lib "gdi32" (ByVal hdc As Long, lpPoint As POINTAPI, ByVal nCount As Long) As Long
      

  3.   

    回复人: victorycyz(中海) ( ) 信誉:110  2004-03-23 08:55:00  得分:0     定义合适的字体、前景色,然后:    picture1.print "★"
     
    这个方法绝了!偶真想给你分.....可惜我还是初级用户,没法给.
      

  4.   


        ColdMooon(月光寒), 谢谢。
      

  5.   

    楼主是因为picture1.print "★" 不容易满足要求才来问的吧
      

  6.   

    昏.....这种办法你们也想得出来,俺服了You!:)
      

  7.   

    那方法禁止太jue,不過vb有時候就是必須出絕招的
      

  8.   

    flyingscv(zlj) 说的没错。。谢谢各位,我就是用这个方法的。
    我开始发的贴
    http://expert.csdn.net/Expert/topic/2873/2873636.xml?temp=7.674807E-02我还是想了解一下用绘制五角星的算法,所以才发这个贴,
    flyingZFX(飞翔)的回答不错,但我不知道,它那十个点的坐标是如何得来得?(虽然可以用几何计算得到,但不知道有没有更简单得算法),我想任意给出一个五角星得外接圆半径,及中心坐标,画出一个五角星,并填充颜色继续讨论。
      

  9.   

    http://search.csdn.net/expert/topic/51/5101/2003/4/21/1690700.htm
    http://expert.csdn.net/Expert/topic/2559/2559303.xml?temp=.962002
      

  10.   

    Option Explicit
    Const Pi As Double = 3.14159265
    Private Sub Draw(r As Double, x As Double, y As Double, c As Long)
        Dim i As Long
        Dim R1 As Double
        Dim x1 As Double
        Dim y1 As Double
        Dim a1 As Double
        Dim a2 As Double
        
        Me.FillColor = c
        Me.FillStyle = 0
        R1 = r * Cos(Pi / 10) + r * Sin(Pi / 10) / Atn(54 / 180 * Pi)
        
         For i = 1 To 5
            x1 = x + r * Cos((72 * (i - 1) + 90) / 180 * Pi)
            y1 = y - r * Sin((72 * (i - 1) + 90) / 180 * Pi)
            
            a1 = (36 + (i + 2) * 72) / 180 * Pi
            a2 = ((i + 3) * 72) / 180 * Pi
            
            If a2 > Pi * 2 Then
                a1 = a1 - Pi * 2
                a2 = a2 - Pi * 2
            End If
            Me.Circle (x1, y1), R1, c, -a1, -a2
        Next i
    End SubPrivate Sub Command1_Click()
        Draw 200, 4000, 2000, RGB(255, 0, 0)
    End Sub
      

  11.   

    放个commandbox就行了
    Private Sub Draw(r As Double, x As Double, y As Double, c As Long)
    r 半径 x y 中心坐标   c 填充色
    用角度算的,过程就不告诉你了:)