如何使用C#创建偏移多边形 [英] How to create Offset Polygon using C#

查看:274
本文介绍了如何使用C#创建偏移多边形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用Windows窗体创建偏移多边形。



我使用预定义的位置设计了它但是



我想从用户那里获得输入(新旧多边形之间的距离

I need to create offset polygon using Windows forms.

I have designed it using predefined locations but

I want to get inputs from user (distance between new and old polygon

推荐答案

保存用于创建第一个多边形的坐标对。 />


然后,提供一个界面来获取用户的两个偏移坐标。



创建另一个图形通过计算更改的原始多边形点位置,或在原始图形路径上使用矩阵变换中的translate进行路径。
Save the co-ordinate pairs you used to create the first polygon.

Then, present an interface to get the two offset co-ordinates from the user.

Create another graphics path by either calculating the changed original polygon points locations, or using translate in a matrix transform on the original graphics path.


这篇关于如何使用C#创建偏移多边形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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