Results 1 to 3 of 3

Thread: [RESOLVED] [2005] Draw circle with levels of transparency

  1. #1

    Thread Starter
    Frenzied Member stimbo's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,739

    Resolved [RESOLVED] [2005] Draw circle with levels of transparency

    Title says it all really. I have an image in a picturebox.

    When I send a paint event to it I want a circle to appear of a certain size (which I've done) and have a light blue (for example) circle appear on the image but to be semi-transparent so I can still see what's underneath.

    Is this possible? I found the option of:

    VB Code:
    1. g.FillEllipse(Brushes.Transparent, etc...)

    but it's an all or nothing thing. Any advice or links would be very much appreciated.
    Stim

    Free VB.NET Book Chapter
    Visual Basic 2005 Cookbook Sample Chapter

  2. #2
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Lancashire UK
    Posts
    375

    Re: [2005] Draw circle with levels of transparency

    You need to create a colour from ARGB

    VB Code:
    1. Dim g As Graphics = e.Graphics
    2.         Dim brs As SolidBrush
    3.         Dim clr As Color
    4.         clr = Color.FromArgb(20, 0, 0, 45)
    5.         brs = New SolidBrush(clr)
    6.         g.FillEllipse(brs, 10, 10, 100, 100)

    This is off my head as an example so no gaurentees

  3. #3

    Thread Starter
    Frenzied Member stimbo's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,739

    Re: [2005] Draw circle with levels of transparency

    Perfect!

    Works a treat.
    Stim

    Free VB.NET Book Chapter
    Visual Basic 2005 Cookbook Sample Chapter

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