Solved

Ring Of Light

Posted on 2006-11-02
5
252 Views
Last Modified: 2010-04-16
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
Comment
Question by:schenkp
  • 2
  • 2
5 Comments
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 17860462
Like making an irregular shaped form the shape of a Music CD?
0
 

Author Comment

by:schenkp
ID: 17861126
Yes....it to be touching the outer edges of a sqaure form, like a box with the ring around it.
0
 
LVL 15

Accepted Solution

by:
ozymandias earned 500 total points
ID: 17861335
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
 
LVL 15

Expert Comment

by:ozymandias
ID: 17861346
This gives you a 710 x 710 transparent gif in the middle of which is a 700 diameter white circle.
0
 

Author Comment

by:schenkp
ID: 17866906
How do i use this as a class?  Or rather how can i put it into a test project.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question