Results 1 to 4 of 4

Thread: fillstyle

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    15
    see the following code...

    Private Sub Form_Paint()
    Dim r As Single, initR As Single
    Dim x As Single, y As Single, qbc As Integer

    ' Start with a clean surface.
    Cls
    ' The center of all circles
    x = ScaleWidth / 2: y = ScaleHeight / 2
    ' Initial radius is the lower of the two values.
    If x < y Then initR = x Else initR = y
    FillStyle = vbFSSolid ' Circles are filled.
    ' Draw circles, from the outside in.
    For r = initR To 1 Step -(initR / 16)
    ' Use a different color for each circle.
    FillColor = QBColor(qbc)
    qbc = qbc + 1
    Circle (x, y), r
    Next
    ' Restore regular filling style.
    FillStyle = vbFSTransparent
    End Sub

    i wondering what is the purpose of setting the fillstyle to vbfssolid and vbfstransparent ...

    thank for any help!

    MS VB Enterprise, C

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    FillStyle = vbFSSolid ' Circles are filled.

    the code is documented....
    as transparant you only get lines
    no color fill....

    If code is not commented, an easy way to help understand waht it does and doesn't do is to comment out lines and see what happens...play with things.
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    Setting the fillstyle to vbFSSolid means that when you draw a shape, the entire region covered by the shape is coloured in. The standard fill style will simply draw the outline.

    i.e.
    Code:
    FillStyle = vbFSSolid
    Circle (x, y), r  ' paints a solid disc centered on x,y
    
    FillStyle = vbFSTransparent
    Circle (x, y), r  ' paints a circle outline centered on x,y
    Clear?

    Paul.

    Not nearly so tired now...

    Haven't been around much so be gentle...

  4. #4

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    15
    clear ....

    thank!
    MS VB Enterprise, C

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width