Solved

Ring Of Light

Posted on 2006-11-02
5
259 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 86

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

729 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