上回获取完头文件信息了~这回该绘图了~
我们将LAS的文件用C#的GDI+绘制到picturebox里,当然用BITMAP类型了~首先当然要获取LAS文件的头文件信息啦~有宽,高,点等。
map = new Bitmap(pictureBox1.Width, pictureBox1.Height);
map.MakeTransparent();
Color color = new Color();
for (int n = 0; n < point_X.Count; n++)
{
int ex = (int)px[n] - (int)pic_x_min;
int ey = (int)py[n] - (int)pic_y_min;
int e_view = p_view[n];
if (method == 1)//Intensity,绘制利用点的INTENSITY属性来分类
{
if (e_view >= 0 && e_view < 20)
{
color = Color.Gray;
}
else if (e_view >= 20 && e_view < 40)
{
color = Color.Blue;
}
else if (e_view >= 40 && e_view < 60)
{
color = Color.Green;
}
else if (e_view >= 60 && e_view < 80)
{
color = Color.Red;
}
else
{
color = Color.Yellow;
}
}
}
效果图:


