Solved

Ring Of Light

Posted on 2006-11-02
5
245 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now