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的更多相关文章

  1. 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 ...

  2. 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 ...

  3. matlab-可视化图像阈值选择GUI工具

    话不多说,先看图,这是导入一张图后运行的效果. 在此函数中,左图是灰度图加上colorBar后的彩色效果图,右图是二值化后的图,下面是可调节阈值的灰度直方图. 左上角的按钮是回归初始状态,右上角的按钮 ...

  4. vbscript multiple line syntax

    Vbscript 如何将输出内容换行? ' VbCrLf represetns Carriage return–linefeed combination, for more information s ...

  5. 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 ...

  6. 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 ...

  7. 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 ...

  8. 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 ...

  9. [shell test] multiple conditions

      Classic technique (escape metacharacters): if[ \( $g -eq 1-a "$c"="123" \) -o ...

随机推荐

  1. 【AtCoder】ARC074

    ARC 074 C - Chocolate Bar 直接枚举第一刀横切竖切,然后另一块要求如果横切分成\(H / 2\)竖切分成\(W/2\)即可 #include <bits/stdc++.h ...

  2. python函数式编程——返回函数

    1.函数作为返回值 高阶函数除了可以接受函数作为参数外,还可以把函数作为结果值返回. 2.闭包 注意到返回的函数在其定义内部引用了局部变量args,所以,当一个函数返回了一个函数后,其内部的局部变量还 ...

  3. Centos6.5安装Apache ab性能测试工具

    ab简洁: ab是apache自带的压力测试工具,ab是apachebench命令的缩写. ab不仅可以对apache服务器进行网站访问压力测试,也可以对或其它类型的服务器进行压力测试. ab是一个h ...

  4. HDU4622 Reincarnation 字符串 SAM

    原文链接https://www.cnblogs.com/zhouzhendong/p/HDU4622.html 题目传送门 - HDU4622 题意 多组数据. 对于每一组数据,给定一个字符串 s , ...

  5. P1005 矩阵取数游戏 区间dp 高精度

    题目描述 帅帅经常跟同学玩一个矩阵取数游戏:对于一个给定的n \times mn×m的矩阵,矩阵中的每个元素a_{i,j}ai,j​均为非负整数.游戏规则如下: 每次取数时须从每行各取走一个元素,共n ...

  6. HDFS-HA高可用 | Yarn-HA

    HDFS-HA HA(High Available),即高可用(7*24小时不中断服务) 单点故障即有一台机器挂了导致全部都挂了:HA就是解决单点故障,就是针对NameNode: 主Active:读写 ...

  7. springboot拦截器中获取配置文件值

    package com.zhx.web.interceptor; import com.zhx.util.other.IpUtil; import org.slf4j.Logger; import o ...

  8. webpack的总结

    1,首先 项目的入口----package的入口 "scripts": { "dev": "node build/dev-server.js" ...

  9. Pushing Boxes POJ - 1475 (嵌套bfs)

    Imagine you are standing inside a two-dimensional maze composed of square cells which may or may not ...

  10. Xamarin Essentials教程发送邮件Email

    Xamarin Essentials教程发送邮件Email   邮件是一种更为灵活的数据分享方式.它可以帮助用户将一个应用程序的数据分享给其他用户,而其他用户不需要安装特定的应用程序,就可以在任意时间 ...