Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using the code below to create numerous randomly positioned filled circles on the screen. But I need the filled circles to be transparent so that the user can see the circles that are underneath or overlapping. Is there an easy way to do this??

VB
Private Sub MakeCircles ()
Import System.Drawing.Drawing2D  
Dim Xtemp, Ytemp As Integer
Dim Ltemp As Single
Dim ShapeBrush As New Drawing2D.HatchBrush(HatchStyle.Min, Color.Black, Color.White)
Dim PenColor As New Pen(Color.Black, 2)
Dim MakeShapes As Graphics
               
MakeShapes = Me.CreateGraphics
For temp = 1 To 70
    Xtemp = 15 + (Rnd() * 800)
    Ytemp = 15 + (Rnd() * 350)
    Ltemp = 20 + (Rnd() * 200)
    Wtemp = 20 + (Rnd() * 200)
    MakeShapes.FillEllipse(ShapeBrush, Xtemp, Ytemp, Ltemp, Wtemp)
    MakeShapes.DrawEllipse(PenColor, Xtemp, Ytemp, Ltemp, Wtemp)
Next


Thanks
Gary V
Posted
Updated 1-Jan-11 12:28pm
v2
Comments
Manfred Rudolf Bihy 1-Jan-11 18:29pm    
Edit: Code tags added.

1 solution

 
Share this answer
 
Comments
Manfred Rudolf Bihy 1-Jan-11 18:35pm    
I was going to say that ... 5+
GaryV100 1-Jan-11 18:54pm    
WOW That worked!!!! Thanks so much!!!
Gary V
Sergey Alexandrovich Kryukov 1-Jan-11 21:40pm    
Quite easy, isn't? A 5, anyway.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900