GDI+: regions, paths, and custom controls

G

Guest

I am creating a custom control by setting control's .Region property to a region, created by manipulating GraphicsPath objects. Something like this

GraphicsPath oCirclePath = new GraphicsPath(FillMode.Alternate)
oCirclePath.AddEllipse(oRect)

Region oRegionCircle = new Region(oCirclePath)
Region oRegionCut = new Region(oRectCut)

oRegionCut.Xor(oRegionCircle)
oCtrlRegion.Exclude(oRegionCircle)
oCtrlRegion.Union(oRegionCut)

This code cuts a circle-like shape from the center of the control, so this control, like a frame, can mask off part of control below it (you can see through the cut-out part of the control)

The problem I am having is that the inside borders (edges) of the control are not really smooth. The circle visibly consists of small number of lines, making it look pretty bad. I am using SmoothingMode.AntiAlias for SmoothingMode anywehere I can :) --- it doesn't help

So, I guess the question is how to make it smoother? Also, I don't think I understand which object is responsible for drawing that border (.Region) -- is it the control itself or the control it's added to

I appreciate any suggestions

VR
 
J

Jeffrey Tan[MSFT]

Hi VR,

Based on my understanding, you want to implement a smooth rounded
rectangle.

If I did not misunderstand you, please refer to:
"How to draw a rounded rectangle"
http://www.bobpowell.net/roundrects.htm

Also, the Bob Powell has a GDI+ FAQ, please refer to:
http://www.bobpowell.net/gdiplus_faq.htm

If I misunderstand you, please feel free to feedback, and provide some code
for me to reproduce your problem, I will help you.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

Jeffrey Tan[MSFT]

Hi VR,

Sorry for letting you wait for so long time.

Looking at the nature of this issue, it would require intensive
troubleshooting which would be done quickly and effectively with direct
assistance from a Microsoft Support Professional through Microsoft Product
Support Services.
You can contact Microsoft Product Support directly to discuss additional
support options you may have available, by contacting us at 1-(800)936-5800
or by choosing one of the options listed at
http://support.microsoft.com/default.aspx?scid=sz;en-us;top. If this is not
an urgent issue and your would like us to create an incident for you and
have Microsoft Customer Service Representative contact you directly,
please send email to (remove "online." from this no Spam email address):
mailto:[email protected] with the following information,

*Include "Followup: <Tomcat IssueID>" in the email Subject.
*Location of the post
*Subject Line
*First Name, Last Name
*MSDN Subscriber ID
*Company name (if any)
*Phone number
*e-mail address

Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
G

Guest

Jeffrey

Thanks for your help. If I were to try to resolve this issue through you (newsgroups) by e-mailing (e-mail address removed), would I be charged for support

Thanks
V

----- \"Jeffrey Tan[MSFT]\" wrote: ----

Hi VR

Sorry for letting you wait for so long time

Looking at the nature of this issue, it would require intensive
troubleshooting which would be done quickly and effectively with direct
assistance from a Microsoft Support Professional through Microsoft Product
Support Services.
You can contact Microsoft Product Support directly to discuss additional
support options you may have available, by contacting us at 1-(800)936-5800
or by choosing one of the options listed at
http://support.microsoft.com/default.aspx?scid=sz;en-us;top. If this is not
an urgent issue and your would like us to create an incident for you and
have Microsoft Customer Service Representative contact you directly,
please send email to (remove "online." from this no Spam email address):
mailto:[email protected] with the following information

*Include "Followup: <Tomcat IssueID>" in the email Subject
*Location of the post
*Subject Lin
*First Name, Last Nam
*MSDN Subscriber I
*Company name (if any
*Phone number
*e-mail addres

Thanks for your understanding

Best regards
Jeffrey Ta
Microsoft Online Partner Suppor
Get Secure! - www.microsoft.com/securit
This posting is provided "as is" with no warranties and confers no rights
 
J

Jeffrey Tan[MSFT]

Hi VR,

As a MSDN Subscriber customer, you should have 2 free support instances,
but if you have used out these 2 free support instances, you have to pay
for the Support Professional.

Through PSS, you will get a one-by-one support on your issue. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
G

Guest

Thanks for your help on this issue

V

----- \"Jeffrey Tan[MSFT]\" wrote: ----

Hi VR

As a MSDN Subscriber customer, you should have 2 free support instances,
but if you have used out these 2 free support instances, you have to pay
for the Support Professional

Through PSS, you will get a one-by-one support on your issue. Thank

Best regards
Jeffrey Ta
Microsoft Online Partner Suppor
Get Secure! - www.microsoft.com/securit
This posting is provided "as is" with no warranties and confers no rights
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top