在C#中应用MapObjects(渲染效果)

在 C# 中应用 MapObjects( 渲染效果 )

摘要: MapObjects C# 渲染 专题图

作者:杨雨田 [email protected]

以前用 MapX ,里面有专题图,挺好。经过几天的试验,我把 MapObjects 中的各种渲染效果(类似 MapX 专题图,但不一样)都试了试,下面附上源代码,如果那位有不懂的地方请自己琢磨,哈哈 …

代码如下:

using System;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

using System.Data;

namespace DbInMo

{

///

1<summary>
2
3///  Form1 的摘要说明。 
4
5///  </summary>

public class 渲染示例 : System.Windows.Forms.Form

{

private AxMapObjects2.AxMap map;

private System.Windows.Forms.Button 直方图;

private System.Windows.Forms.Button 饼图;

private System.Windows.Forms.Button 点密度;

private System.Windows.Forms.Button 按值渲染;

private System.Windows.Forms.Button 分类渲染;

private System.Windows.Forms.Button Z值渲染;

private System.Windows.Forms.Button 组渲染;

private System.Windows.Forms.Button 退出;

private System.Windows.Forms.Panel 操作板;

private System.Windows.Forms.Button 删除所有渲染;

private System.Windows.Forms.Panel panel1;

private System.Windows.Forms.Button 全图;

private System.Windows.Forms.Button 拖动;

private System.Windows.Forms.Button 缩小;

private System.Windows.Forms.Button 放大;

private System.Windows.Forms.Panel 分隔符;

private System.Windows.Forms.Button 标注渲染;

///

1<summary>
2
3///  必需的设计器变量。 
4
5///  </summary>

private System.ComponentModel.Container components = null ;

public 渲染示例()

{

//

// Windows 窗体设计器支持所必需的

//

InitializeComponent();

//

// TODO: 在 InitializeComponent 调用后添加任何构造函数代码

//

}

///

1<summary>
2
3///  清理所有正在使用的资源。 
4
5///  </summary>

protected override void Dispose( bool disposing )

{

if ( disposing )

{

if (components != null )

{

components.Dispose();

}

}

base .Dispose( disposing );

}

#region Windows 窗体设计器生成的代码

///

1<summary>
2
3///  设计器支持所需的方法 - 不要使用代码编辑器修改 
4
5///  此方法的内容。 
6
7///  </summary>

private void InitializeComponent()

{

System.Resources.ResourceManager resources = new System.Resources.ResourceManager( typeof (渲染示例));

this .map = new AxMapObjects2.AxMap();

this .操作板 = new System.Windows.Forms.Panel();

this .直方图 = new System.Windows.Forms.Button();

this .饼图 = new System.Windows.Forms.Button();

this .点密度 = new System.Windows.Forms.Button();

this .按值渲染 = new System.Windows.Forms.Button();

this .分类渲染 = new System.Windows.Forms.Button();

this .Z值渲染 = new System.Windows.Forms.Button();

this .组渲染 = new System.Windows.Forms.Button();

this .退出 = new System.Windows.Forms.Button();

this .标注渲染 = new System.Windows.Forms.Button();

this .删除所有渲染 = new System.Windows.Forms.Button();

this .panel1 = new System.Windows.Forms.Panel();

this .全图 = new System.Windows.Forms.Button();

this .拖动 = new System.Windows.Forms.Button();

this .缩小 = new System.Windows.Forms.Button();

this .放大 = new System.Windows.Forms.Button();

this .分隔符 = new System.Windows.Forms.Panel();

((System.ComponentModel.ISupportInitialize)( this .map)).BeginInit();

this .操作板.SuspendLayout();

this .SuspendLayout();

//

// map

//

this .map.Dock = System.Windows.Forms.DockStyle.Fill;

this .map.Location = new System.Drawing.Point(0, 0);

this .map.Name = "map";

this .map.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("map.OcxState")));

this .map.Size = new System.Drawing.Size(616, 429);

this .map.TabIndex = 0;

this .map.MouseDownEvent += new AxMapObjects2._DMapEvents_MouseDownEventHandler( this .map_MouseDownEvent);

//

// 操作板

//

this .操作板.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;

this .操作板.Controls.Add( this .删除所有渲染);

this .操作板.Controls.Add( this .panel1);

this .操作板.Controls.Add( this .全图);

this .操作板.Controls.Add( this .拖动);

this .操作板.Controls.Add( this .缩小);

this .操作板.Controls.Add( this .放大);

this .操作板.Controls.Add( this .分隔符);

this .操作板.Controls.Add( this .标注渲染);

this .操作板.Controls.Add( this .退出);

this .操作板.Controls.Add( this .组渲染);

this .操作板.Controls.Add( this .Z值渲染);

this .操作板.Controls.Add( this .分类渲染);

this .操作板.Controls.Add( this .按值渲染);

this .操作板.Controls.Add( this .点密度);

this .操作板.Controls.Add( this .饼图);

this .操作板.Controls.Add( this .直方图);

this .操作板.Dock = System.Windows.Forms.DockStyle.Right;

this .操作板.Location = new System.Drawing.Point(496, 0);

this .操作板.Name = "操作板";

this .操作板.Size = new System.Drawing.Size(120, 429);

this .操作板.TabIndex = 1;

//

// 直方图

//

this .直方图.Dock = System.Windows.Forms.DockStyle.Top;

this .直方图.Location = new System.Drawing.Point(0, 0);

this .直方图.Name = "直方图";

this .直方图.Size = new System.Drawing.Size(116, 24);

<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; T

Published At
Categories with Web编程
Tagged with
comments powered by Disqus