如何在重叠时将两个椭圆连接或混合在一起 [英] How to join or blend two ellipses together when they overlap

查看:708
本文介绍了如何在重叠时将两个椭圆连接或混合在一起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想知道当它们彼此接触时是否存在混合椭圆的功能。我正在考虑一个GraphicsPath对象,因为它将对象添加到它的路径中。如果有一个术语,我不知道它会是什么,所以搜索到目前为止还没有透露任何内容。感谢您提供一些指导。



示例

Was wondering if there was a function for blending ellipses when they make contact with each other. I was thinking about a GraphicsPath object since it adds objects to it's path. If there is a term for this I do not know what it would be so searching has not revealed anything thus far. Thanks for some guidance.

Example

推荐答案

您在使用graphicspath的正确路径上。

您创建2个图形路径并添加由矩形定义的椭圆。

根据路径构造函数创建2个区域

调用r.Intersect将r转换为你正在寻找的区域

相反,调用r2.Intersect会将r2转换为你想要的区域



You are on the right path with graphicspath.
You create 2 graphics paths and add the ellipses defined by a rectangle.
Create 2 regions based on the path constructors
calling r.Intersect will transform r into the region you are looking for
conversely, calling r2.Intersect will transform r2 into the region you are looking for

Dim path1 As New Drawing2D.GraphicsPath()
path1.AddEllipse(New Rectangle(0, 0, 10, 20))
Dim path2 As New Drawing2D.GraphicsPath()
path2.AddEllipse(New Rectangle(0, 0, 10, 20))
Dim r As New Region(path1)
Dim r2 As New Region(path2)
r.Intersect(path2)


这篇关于如何在重叠时将两个椭圆连接或混合在一起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆