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 ...
随机推荐
- 基于spring security 实现前后端分离项目权限控制
前后端分离的项目,前端有菜单(menu),后端有API(backendApi),一个menu对应的页面有N个API接口来支持,本文介绍如何基于spring security实现前后端的同步权限控制. ...
- 【Android】application标签说明
<application> <application android:allowClearUserData=["true" | "false" ...
- Nginx+Redis+Ehcache大型高并发高可用三层架构总结
在生产环境中,对于高并发架构,我们知道缓存 是最重要的环节,对于大量的高并发.可以采用三层缓存架构来实现,也就是Nginx+Redis+Ehcache 对于中间件Nginx常来做流量分发,同事ngin ...
- 带你了解zabbix如何监控mysql主从到报警触发
本章博客我们一起来聊一聊如何监控mysql数据库主从状态? 思路梳理: 1)首先我们都知道,判断Mysql主从是否正常,是通过主从上面的SQL和IO线程都为yes状态判断(通过awk取值,grep过滤 ...
- HDU3718 Similarity KM
原文链接http://www.cnblogs.com/zhouzhendong/p/8284763.html 题目传送门 - HDU3718 题意概括 直接描述输入吧 首先一个T(T<15),表 ...
- 今天这篇内容分享Apache由http自动跳转到https的多种方法
本文主要和大家分享Apache http自动跳转到https的几种方法,非常不错,具有参考借鉴价值,需要的朋友参考下 本文主要和大家分享Apache http自动跳转到https的几种方法,当你的站点 ...
- 空间数据可视化:1. 3D_Bar图表| 空间柱状图
1.Sublime的使用 中文版的配置 https://jingyan.baidu.com/article/ca2d939d1e83feeb6c31cefc.html (百度经验) sublime里边 ...
- Maya Max python PySide集成 shiboken版本对应关系
Maya_Max _python_PySide集成_shiboken版本对应关系 1.如何查看 Maya Max 集成的 Python版本: Maya:在 Maya 的安装目录下的 bin 文件夹中找 ...
- NSL:SOFM神经网络实现预测哪个样本与哪个样本处在同一层,从而科学规避我国煤矿突水灾难—Jason niu
load water_data.mat attributes = mapminmax(attributes); P_train = attributes(:,1:35); T_train = clas ...
- 004.MySQL双主+Keepalived高可用
一 基础环境 主机名 系统版本 MySQL版本 主机IP Master01 CentOS 6.8 MySQL 5.6 172.24.8.10 Master02 CentOS 6.8 MySQL 5.6 ...