C# Draw multiple Lines
I would make a Line class having start and end point of the line in struct Point and make list of that class instead of having four arrays.
public class MyLine
{
public Point StartPoint {get; set;}
public Point EndPoint {get; set;}
public void DrawLine()
{
//Draw line code goes here
}
}
Now you have line class with required field and method to draw line. You drawLines method that might be in some other class will create list of MyLine class and can draw that list of Lines using Line class method DrawLine
private void DrawLines()
{
List<MyLine> listMyLines = new List<MyLine>();
listMyLines.Add(new MyLine{StartPoint = new Point(0, 100), EndPoint = new Point(334, 100)});
for (int i = 0; i < listMyLines.Count; i++)
{
listMyLines[i].DrawLine();
}
}
C# Draw multiple Lines的更多相关文章
- Linux/shell: Concatenate multiple lines to one line
$ cat file START Unix Linux START Solaris Aix SCO 1. Join the lines following the pattern START with ...
- Latex: Expression under summation on multiple lines
Purpose Describe the sum symbol like this: zebk=1Nk∑i∈Rkj∈W(i)∩Rkmax(fi−fj) Solution code z_{ebk}=\f ...
- matlab-可视化图像阈值选择GUI工具
话不多说,先看图,这是导入一张图后运行的效果. 在此函数中,左图是灰度图加上colorBar后的彩色效果图,右图是二值化后的图,下面是可调节阈值的灰度直方图. 左上角的按钮是回归初始状态,右上角的按钮 ...
- vbscript multiple line syntax
Vbscript 如何将输出内容换行? ' VbCrLf represetns Carriage return–linefeed combination, for more information s ...
- abap alv multiple header using write
A standard SAP ALV list report will show only one line header, but there will be a requirement somed ...
- Draw your Next App Idea with Ink to Code
Imagine that you’ve just been struck by inspiration for your next great app. You might start by jott ...
- CF961D Pair Of Lines
题目描述 You are given n n n points on Cartesian plane. Every point is a lattice point (i. e. both of it ...
- Codeforces 961 D Pair Of Lines
题目描述 You are given nn points on Cartesian plane. Every point is a lattice point (i. e. both of its c ...
- [shell test] multiple conditions
Classic technique (escape metacharacters): if[ \( $g -eq 1-a "$c"="123" \) -o ...
随机推荐
- 一起学Hadoop——Hadoop的前世今生
Hadoop是什么? Hadoop是一个处理海量数据的开源框架.2002年Nutch项目面世,这是一个爬取网页工具和搜索引擎系统,和其他众多的工具一样,都遇到了在处理海量数据时效率低下,无法存储爬取网 ...
- 学号:20165239 预备作业3 Linux安装及学习
实验三 用户及文件权限管理 之前从未接触过虚拟机,借着老师布置的任务,这次寒假初次接触了虚拟机,既紧张又兴奋,在学习了老师的一部分教程以及查阅网上的资料之后,有了以下的学习笔记和心得. 一.Linux ...
- 洛谷3825 [NOI2017]游戏 2-sat
原文链接http://www.cnblogs.com/zhouzhendong/p/8146041.html 题目传送门 - 洛谷3825 题解 我们考虑到地图中x的个数很少,最多只有8个. 所以我们 ...
- 启动tomcat出现Removing obsolete files from server... Could not clean server of obsolete ……错误
在Eclipse启动tomcat出现"Removing obsolete files from server... Could not clean server of obsolete …… ...
- rc.local(ubuntu18.04)
系统自带服务/lib/systemd/system/rc-local.service 软连接为 /lib/systemd/system/rc.local.service -> rc-local. ...
- Windows 下安装 Ubuntu 双系统(更新)
Windows + Ubuntu 16.04 ---> 双系统 前言:本篇文章是对之前文章的更新,更新的主内容是把原来用手机拍摄的图片换成了虚拟机的截图,以及对磁盘划分的新的见解和一些使用感受, ...
- Python 2 和 3 的区别记录
Python 2 和 3 的区别记录 print 2:关键字,可以 print a,也可以 print(a) 3:内置函数,必须带(),print(a) reload() 2:内置函数,可以直接使用 ...
- python和yum同时卸载后的安装方法
centos 7如果卸载了yum和python之后恢复的办法(该方法已经测试). 1. 安装python. python-libs-2.7.5-34.el7.x86_64.rpm python-2.7 ...
- 关于pycharm中安装第三方库时报错的解决办法(一)
记录自己的生活! 一.事发背景 在pycharm中直接安装第三方库时因为版本问题总是无法安装成功,事情不大,但是很重要. 二.经过 最开始我自己电脑上安装了Python3.6和Python2. ...
- hdu1429 胜利大逃亡(续) 【BFS】+【状态压缩】
题目链接:https://vjudge.net/contest/84620#problem/K 题目大意:一个人从起点走到终点,问他是否能够在规定的时间走到,在走向终点的路线上,可能会有一些障碍门,他 ...