• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

Ring Of Light

If i wanted to create a circle of light say 700 p hight and 700p wide, the center of the ring would be transparent and so would everything on the outer side of the ring...

How could i do this?
0
schenkp
Asked:
schenkp
  • 2
  • 2
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Like making an irregular shaped form the shape of a Music CD?
0
 
schenkpAuthor Commented:
Yes....it to be touching the outer edges of a sqaure form, like a box with the ring around it.
0
 
ozymandiasCommented:
Very basic example :

using System;
using System.Drawing;


namespace Drawing1
{
      /// <summary>
      /// Summary description for Class1.
      /// </summary>
      class Class1
      {
            
            [STAThread]
            static void Main(string[] args)
            {
                  Bitmap b = new Bitmap(710,710);
                  b.MakeTransparent(Color.WhiteSmoke);
                  Graphics g = Graphics.FromImage(b);
                  g.Clear(Color.WhiteSmoke);
                  g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
                  g.DrawEllipse(new Pen(Brushes.White, 6f), 5 , 5, 700, 700);
                  b.Save(new System.IO.FileStream(@"c:\temp\lightring.gif",System.IO.FileMode.Create), System.Drawing.Imaging.ImageFormat.Gif);      
            }
      }
}
0
 
ozymandiasCommented:
This gives you a 710 x 710 transparent gif in the middle of which is a 700 diameter white circle.
0
 
schenkpAuthor Commented:
How do i use this as a class?  Or rather how can i put it into a test project.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now