资源简介
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
相关资源
- 383C开发大全(提高卷)源码.rar
- 0145、低成本可调数显稳压电源(1.3
- refined_Lee_fliter.rar
- shadowsocks-libev_2.5.5-1_amd64_Ubuntu14.04.de
- 普林斯顿微积分读本视频列表.txt
- WannaCry勒索病毒一键加固脚本v1.05by叉
- WINDOWS聊天课程设计报告
- sccm.txt序列号.txt
- 8taesy.rar
- luke1215_10971614.txt
- MyTest.zip
- FFMpeg_SDK_详细中文指南开发手册.pdf
- NMSPublishSubscribe.zip
- 序列号吗.txt
- 完美DDOS破解版.rar
- 智慧树刷课.txt
- xmr-CentOS6_64bit-rebuild-20181019.zip
- xmr-CentOS7_64bit-rebuild-20181019.zip
- 东华HIS数据库表结构.docx
- vrt0el.zip
- 《xxxx》游戏屏蔽词库.docx
- 04.mpu6050_dmp.zip
- longyue1859_5563031.zip
- wincc报表.part2.rar
- Fuzzycontrol使用经验手册.pdf
- Unicursal.rar
- ifive_mini3视网膜版本_miui小米系统内存
- 几十个G的尚硅谷最新大数据项目视频
- C2CppCrk.rar
- QQ聊天记录查看器5.3.rar
评论
共有 条评论