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 ...
随机推荐
- JMeter实现登录初始化(类似LR的init函数功能实现)
1.项目背景 在做项目的性能测试过程中,发现系统的登录功能非常慢,所以,在涉及到登录才能操作的场景,尽量避开登录操作 解决方案: 首选设置“登录并生成签名值”线程组
- 基于springboot通过自定义注解和AOP实现权限验证
一.移入依赖 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spri ...
- MySQL安装教程图解
核心提示:下面的是MySQL安装的图解,用的可执行文件安装的,详细说明了一下! 下面的是MySQL安装的图解,用的可执行文件安装的,详细说明了一下! MySQL下载地址 打开下载的mysql安装文件m ...
- Thinkphp3.1 php 链接SqlServer
ThinkPHP链接 M("lk_employeeInfo","Null/表前缀","sqlsrv://账号:密码@服务器:端口/数据库") ...
- springboot学习——第二集:整合Mybaits
1,Mybatis动态插入(insert)数据(使用trim标签):https://blog.csdn.net/h12kjgj/article/details/55003713 2,mybatis 中 ...
- 线段树(lazy)-hdu1689
题目链接:https://vjudge.net/problem/HDU-1698 题目描述: 现在Pudge想做一些操作.让我们将钩子的连续金属棒从1编号到N.对于每个操作,Pudge可以将连续金属棒 ...
- es6的模块化--AMD/CMD/commonJS/ES6
, ); ); }) , )); }); , )); ; export { firstName, lastName, year }; // es6引用 import { firstName, last ...
- Python爬虫:更加优雅的执行JavaScript(PyV8)
https://www.jianshu.com/p/c534d6eb881a?utm_source=oschina-app
- async函数
async函数的实现原理,就是将Generator函数和自动执行器,包装在一个函数里.async函数返回Promise对象,async函数的return值是then方法的参数,await后跟Promi ...
- OSPF补全计划-0 preface
哇靠,一看日历吓了我一跳,我这一个月都没写任何东西,好吧,事情的确多了点儿,同事离职,我需要处理很多untechnical的东西,弄得我很烦,中间学的一点小东西(关于Linux的)也没往这里记,但是我 ...