Windows Develop Bookmark and Share   
 index > Windows Forms General > Graphic objects
 

Graphic objects

Hi all.

I got fe questions about C# and GDI at Visual Studio 2005(using framework 2.0)

At first, I got two circles and intersect function. And when intersect=true i need to smooth borders of this 2 circles, so they will be like a part of 1 kind a ellipse.

And second questions i got rectangle and function onmouseclick, i am trying to make this rectangle to be non static. Like i clicked on this rectangle i opening new for or just doing something. I tried to describe event onmouseclick with this.region where i described coord. of my rectangle, but it don't work properly.

Anybody have any suggestions with this 2 questions?


With best regards, Al dee

Al dee  Wednesday, April 02, 2008 9:55 PM
Mark Rendle wrote:
I think you need to investigate the Graphics.DrawBezier method, but I can't help you with the maths, I'm afraid.



do you know how convert ellipse into bezier curve?
Al dee  Thursday, April 03, 2008 10:04 PM

Al dee wrote:
I don't see how this will help me. I think i didn't described my problem correctly.I have two circles and if they crossing or intersec each other they should smooth borders. I don't know how to attach images here, so i will explain like this. I have circle "o" and another "o" when they intersect they looking like "8" use the place where they intersect looks nott smooth and i want when they intersect each other they should be like between "8" and "0" i mean borders almoost smoothed. Hope this will help))

Trust me, I understand the math problem. If the circles have the same radius and intersect at only one point, then the two tangents would be two sides of a rectangle. Inthis case,you could connect the endpoints of each tangential line and have a perfect square!

Rudedog

Rudedog2  Thursday, April 03, 2008 10:11 PM

I am no GDI expert, not even close but when I need help with anything GDI and / or drawing in the framework I always check out Bob Powell's site. I have included the link for you.

http://www.bobpowell.net/faqmain.htm

John Hidey from Sharp Dudes  Wednesday, April 02, 2008 10:16 PM
John Hidey wrote:

I am no GDI expert, not even close but when I need help with anything GDI and / or drawing in the framework I always check out Bob Powell's site. I have included the link for you.

http://www.bobpowell.net/faqmain.htm



Thanks John. I found decision about 2nd answer. I just used hit method to graphic objects. But i still cant find answer fo 1st question.
Al dee  Thursday, April 03, 2008 12:57 PM

You just need to calculate the 2 commontangents that touch each side of the circles. If the circles have the same diameter, the problem is trivial. If they don't, the tangents intersect somewhere andform a cone or triangle, if you will.

Rudedog

"Cap'n Crunch"

Rudedog2  Thursday, April 03, 2008 1:22 PM
I don't see how this will help me. I think i didn't described my problem correctly.I have two circles and if they crossing or intersec each other they should smooth borders. I don't know how to attach images here, so i will explain like this. I have circle "o" and another "o" when they intersect they looking like "8" use the place where they intersect looks nott smooth and i want when they intersect each other they should be like between "8" and "0" i mean borders almoost smoothed. Hope this will help))
Al dee  Thursday, April 03, 2008 2:36 PM
I think you need to investigate the Graphics.DrawBezier method, but I can't help you with the maths, I'm afraid.

Mark Rendle  Thursday, April 03, 2008 2:58 PM
Mark Rendle wrote:
I think you need to investigate the Graphics.DrawBezier method, but I can't help you with the maths, I'm afraid.



do you know how convert ellipse into bezier curve?
Al dee  Thursday, April 03, 2008 10:04 PM

Al dee wrote:
I don't see how this will help me. I think i didn't described my problem correctly.I have two circles and if they crossing or intersec each other they should smooth borders. I don't know how to attach images here, so i will explain like this. I have circle "o" and another "o" when they intersect they looking like "8" use the place where they intersect looks nott smooth and i want when they intersect each other they should be like between "8" and "0" i mean borders almoost smoothed. Hope this will help))

Trust me, I understand the math problem. If the circles have the same radius and intersect at only one point, then the two tangents would be two sides of a rectangle. Inthis case,you could connect the endpoints of each tangential line and have a perfect square!

Rudedog

Rudedog2  Thursday, April 03, 2008 10:11 PM

You can use google to search for other answers

Custom Search

More Threads

• Property needs an Object-Instance but there is no instance in designtime
• Flash Screen
• how do i draw lines on a Panel?!
• Properly dispose of object that is in a hashtable
• Panel Adding and removing controls
• Can I remove the dotted line that appears around focused controls?
• Waiting until a form is fully displayed before proceding with code
• Custom Windows service is not working properly
• Hosting IE Control: Backspace Key
• Popup menu...