473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

GDI+ - Need to Create a Ellipse Shaped User Control with Smooth Edge

Hi,

I need to create a Ellipse shaped user control which have folloiwng
attributes:
1) The edges are smooth
2) The control shuld only be selected when click on the ellipse shape & not
when click on the empty area of Client Rectangle

What I have done so far:
I override the OnPaintMethod as below:

protected override OnPaint(PaintEventArgs e)
{
e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
e.Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;

/*
Code to Draw Ellipse using Graphics Path
*/

//graphicsPath = Path on which Ellipse has been added
this.Region = new Region(graphicsPath)
}

Now if I uses the Code - this.Region = new Region(graphicsPath) - the
ellipse get distorted over its edges & if I remove the Code - this.Region =
new Region(graphicsPath) - I got a very smooth edged ellipse, however now the
ellipse shaped user control can be selected on the designer even by clicking
on the empty area of Client Rectangle.
I would be heartly thankful, if someone can give an idea to achieve both of
the above things - Smoothness & Restricted Selection - simultaneously.

Thanks in Anticipation,
Best Regards,
Pankaj gaur
Jun 26 '08 #1
1 3535
Finally Got the solution here :
http://forums.microsoft.com/msdn/ShowPost.aspx?siteid=1&postid=3538110
Jun 27 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Rohit Sharma | last post by:
Hi All, Is the .NET GDI+ limited to drawing in 2D space ? I need to draw in 3D and need to specify the points in terms of X,Y,Z....is this possible in GDI ? Cheers ROhit
2
by: WoodBeeProgrammer | last post by:
When i try using Flatten on my ellipse, i get 6 points no matter how fine i set the flatness parameter. According to my understanding of the documentation, the smaller i make flatness the closer...
2
by: Daniel | last post by:
how come when i do oGraphics.FillEllipse it draws blury? is there anyway to adjust this default compression to not be blury when drawing a simple ellipse?
0
by: dr | last post by:
C# Irregular shaped user controls. How to make usercontrol have transparency key for its background image? I want to have irregular shaped user controls on my form. like a funny shaped button....
1
by: Bishman | last post by:
Hi, I have been trying to get text to scroll smoothly accross a windows form using GDI+ and a timer. Changing the position of the text by a configurable amount and calling invalidate to force a...
0
by: johot | last post by:
I am currently creating a little photo application. In this application the user is able to zoom in the image and after zooming panning around inside the zoomed image with the mouse. The strange...
0
by: =?Utf-8?B?UGFua2FqR2F1cg==?= | last post by:
Hi, I need to create a Ellipse shaped user control which have folloiwng attributes: 1) The edges are smooth 2) The control shuld only be selected when click on the ellipse shape & not when...
9
by: pereges | last post by:
Hello I need some ideas for designing a recursive function for my ray tracing program. The idea behind ray tracing is to follow the electromagnetic rays from the source, as they hit the...
1
by: white007 | last post by:
I am using the following code to generate a semi-ellipse. I want to cut-off the portion below the semi-ellipse and return only the semi-ellipse. Any pointers or path forward will be highly...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.