资源简介
IsoHeightCtrl.zip

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Interop;
using System.Windows.Media.Imaging;
namespace WPFCtrlLib
{
///
/// 等高线图控件
///
public partial class IsoHeightCtrl : UserControl
{
private const int grid_w = 10;
private const int grid_h = 10;
private double w;
private double h;
private int bitmap_w;
private int bitmap_h;
private int x_num;
private int y_num;
private float[] data;
private float min;
private float max;
private byte[] Rs Gs Bs;
private Bitmap bitmap;
private Graphics graphics;
public IsoHeightCtrl()
{
InitializeComponent();
}
private void UserControl_SizeChanged(object sender SizeChangedEventArgs e)
{
Draw();
}
///
/// 离散高度点列表
/// XY总长为单位1
///
public MeasureData[] HeightDots
{
get { return (MeasureData[])GetValue(HeightDotsProperty); }
set { SetValue(HeightDotsProperty value); }
}
public static readonly DependencyProperty HeightDotsProperty =
DependencyProperty.Register(“HeightDots“ typeof(MeasureData[]) typeof(IsoHeightCtrl) new Propertymetadata(null (s e) =>
{
IsoHeightCtrl ihc = s as IsoHeightCtrl;
ihc.Draw();
}));
///
/// 颜色列表
/// 其数量决定了等高线的层数
///
public string ColorList
{
get { return (string)GetValue(ColorListProperty); }
set { SetValue(ColorListProperty value); }
}
public static readonly DependencyProperty ColorListProperty =
DependencyProperty.Register(“ColorList“ typeof(string) typeof(IsoHeightCtrl) new Propertymetadata(“#072FFA#0779FA#07C4FA#07DFD0#07FAA7#79FA57#ECFA07#F3D307#FAAD07#F67207#FA1207“ (s e) =>
{
IsoHeightCtrl ihc = s as IsoHeightCtrl;
ihc.ParseColor();
}));
///
/// 绘制图形
///
private void Draw()
{
if (HeightDots == null)
{
return;
}
w = this.ActualWidth;
h = this.ActualHeight;
if (w <= 0 || h <= 0)
{
return;
}
if (Rs == null)
{
ParseColor();
}
InitData();
CreateBitmap();
float gap = (max - min) / Rs.Length;
for (int i = 0; i < Rs.Length; i++)
{
List
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 16965 2019-06-12 11:05 IsoHeightCtrl.xaml.cs
文件 579 2019-06-12 09:10 IsoHeightCtrl.xaml
- 上一篇:扫雷qmlc程序
- 下一篇:383C开发大全(提高卷)源码.rar
相关资源
- PID_AutoTune_v0.rar
- vspd7.2.308.zip
- 价值2k的H漫画小说系统
- Pythonamp;课堂amp;笔记(高淇amp;400;集第
- ddos压力测试工具99657
- UML建模大全
- 开源1A锂电池充电板TP4056原理图+PCB
- m1卡 ic卡可选择扇区初始化加密软件
- TSCC.exe
- FTP课程设计(服务端+客户端)
- 计算机图形学 边填充算法实现代码
- 电力系统潮流计算程序集合
- oracle数据迁移项目实施方案
- Web Api 通过文件流 文件到本地
- Visio图标-最新最全的网络通信图标库
- Spire API文档
- OpenGL参考手册
- Python中Numpy库最新教程
- SPD博士V5.3.exe
- 直流无刷电机方波驱动 stm32 例程代码
- layui后台管理模板
- 仿知乎界面小程序源代码
- 云平台-阿里云详细介绍
- photoshop经典1000例
- scratch垃圾分类源码(最终版本).sb
- IAR ARM 7.8破解
- TI CCS V5.4 安装步骤及破解文件
- 松下plc FP-XH的驱动
- 局域网硬件信息收集工具
- 加快Windows XP操作系统开机速度
评论
共有 条评论