📄 ezdicomdemo.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace ezDicomCSharp
{
/// <summary>
/// Summary description for MainForm.
/// </summary>
public class MainForm : System.Windows.Forms.Form
{
private System.Windows.Forms.ToolBar toolBar1;
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private System.Windows.Forms.MenuItem menuItem3;
private System.Windows.Forms.MenuItem menuItem4;
private System.Windows.Forms.MenuItem menuMos11;
private System.Windows.Forms.MenuItem menuMos22;
private System.Windows.Forms.MenuItem menuMos33;
private System.Windows.Forms.MenuItem menu_Mosaics;
private System.Windows.Forms.MenuItem z_bestfit;
private System.Windows.Forms.MenuItem z_50;
private System.Windows.Forms.MenuItem z_100;
private System.Windows.Forms.MenuItem z_150;
private System.Windows.Forms.MenuItem z_200;
private System.Windows.Forms.MenuItem file_open;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
private System.Windows.Forms.MenuItem menu_Zooms;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.MenuItem menuColBW;
private System.Windows.Forms.MenuItem menuColHot;
private System.Windows.Forms.MenuItem menuColIBW;
private System.Windows.Forms.MenuItem menuColIHot;
private System.Windows.Forms.MenuItem menu_Colours;
private System.Windows.Forms.MenuItem menuCopy;
private System.Windows.Forms.MenuItem file_saveit;
private System.Windows.Forms.MenuItem file_exit;
private System.Windows.Forms.MenuItem menuAbout;
private System.Windows.Forms.ToolBarButton ContrastButton;
private System.Windows.Forms.ToolBarButton AreaContrastButton;
private System.Windows.Forms.ToolBarButton ZoomInButton;
private System.Windows.Forms.ToolBarButton PanButton;
private System.Windows.Forms.ToolBarButton MeasureButton;
private System.Windows.Forms.ImageList il1;
private AxezDICOMax.AxezDICOMX the_ezdicom;
private System.Windows.Forms.MenuItem menuSmooth;
private System.ComponentModel.IContainer components;
private System.Windows.Forms.MenuItem menuToggleHeader;
private System.Windows.Forms.ContextMenu cm_Zoom;
bool is_smoothed = false;
bool is_header = false;
int current_tool = 0;
int colourscheme = +1;
public MainForm()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MainForm));
this.toolBar1 = new System.Windows.Forms.ToolBar();
this.ContrastButton = new System.Windows.Forms.ToolBarButton();
this.AreaContrastButton = new System.Windows.Forms.ToolBarButton();
this.ZoomInButton = new System.Windows.Forms.ToolBarButton();
this.PanButton = new System.Windows.Forms.ToolBarButton();
this.MeasureButton = new System.Windows.Forms.ToolBarButton();
this.il1 = new System.Windows.Forms.ImageList(this.components);
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.file_open = new System.Windows.Forms.MenuItem();
this.file_saveit = new System.Windows.Forms.MenuItem();
this.file_exit = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.menuCopy = new System.Windows.Forms.MenuItem();
this.menuItem3 = new System.Windows.Forms.MenuItem();
this.menu_Zooms = new System.Windows.Forms.MenuItem();
this.z_bestfit = new System.Windows.Forms.MenuItem();
this.z_50 = new System.Windows.Forms.MenuItem();
this.z_100 = new System.Windows.Forms.MenuItem();
this.z_150 = new System.Windows.Forms.MenuItem();
this.z_200 = new System.Windows.Forms.MenuItem();
this.menuSmooth = new System.Windows.Forms.MenuItem();
this.menu_Colours = new System.Windows.Forms.MenuItem();
this.menuColBW = new System.Windows.Forms.MenuItem();
this.menuColHot = new System.Windows.Forms.MenuItem();
this.menuColIBW = new System.Windows.Forms.MenuItem();
this.menuColIHot = new System.Windows.Forms.MenuItem();
this.menu_Mosaics = new System.Windows.Forms.MenuItem();
this.menuMos11 = new System.Windows.Forms.MenuItem();
this.menuMos22 = new System.Windows.Forms.MenuItem();
this.menuMos33 = new System.Windows.Forms.MenuItem();
this.menuToggleHeader = new System.Windows.Forms.MenuItem();
this.menuItem4 = new System.Windows.Forms.MenuItem();
this.menuAbout = new System.Windows.Forms.MenuItem();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.panel1 = new System.Windows.Forms.Panel();
this.the_ezdicom = new AxezDICOMax.AxezDICOMX();
this.cm_Zoom = new System.Windows.Forms.ContextMenu();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.the_ezdicom)).BeginInit();
this.SuspendLayout();
//
// toolBar1
//
this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.ContrastButton,
this.AreaContrastButton,
this.ZoomInButton,
this.PanButton,
this.MeasureButton});
this.toolBar1.ButtonSize = new System.Drawing.Size(32, 32);
this.toolBar1.Cursor = System.Windows.Forms.Cursors.Default;
this.toolBar1.DropDownArrows = true;
this.toolBar1.ImageList = this.il1;
this.toolBar1.Name = "toolBar1";
this.toolBar1.ShowToolTips = true;
this.toolBar1.Size = new System.Drawing.Size(688, 35);
this.toolBar1.TabIndex = 1;
this.toolBar1.Wrappable = false;
this.toolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.ToolButtonClicked);
//
// ContrastButton
//
this.ContrastButton.ImageIndex = 0;
this.ContrastButton.Tag = "1";
this.ContrastButton.ToolTipText = "Drag mouse to adjust contrast and brightness";
//
// AreaContrastButton
//
this.AreaContrastButton.ImageIndex = 1;
this.AreaContrastButton.Tag = "2";
this.AreaContrastButton.ToolTipText = "Drag mouse over area to adjust contrast to show that area best";
//
// ZoomInButton
//
this.ZoomInButton.ImageIndex = 2;
this.ZoomInButton.Tag = "3";
this.ZoomInButton.ToolTipText = "Click mouse to see an enlargement of the region round it";
//
// PanButton
//
this.PanButton.ImageIndex = 4;
this.PanButton.Tag = "4";
this.PanButton.ToolTipText = "Drag mouse to pan around the image";
//
// MeasureButton
//
this.MeasureButton.ImageIndex = 3;
this.MeasureButton.Tag = "5";
this.MeasureButton.ToolTipText = "Drag mouse to measure distances on the image";
//
// il1
//
this.il1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
this.il1.ImageSize = new System.Drawing.Size(16, 16);
this.il1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("il1.ImageStream")));
this.il1.TransparentColor = System.Drawing.Color.Olive;
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1,
this.menuItem2,
this.menuItem3,
this.menuItem4});
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.file_open,
this.file_saveit,
this.file_exit});
this.menuItem1.Text = "&File";
//
// file_open
//
this.file_open.Index = 0;
this.file_open.Shortcut = System.Windows.Forms.Shortcut.CtrlO;
this.file_open.Text = "&Open";
this.file_open.Click += new System.EventHandler(this.file_open_Click);
//
// file_saveit
//
this.file_saveit.Index = 1;
this.file_saveit.Shortcut = System.Windows.Forms.Shortcut.CtrlS;
this.file_saveit.Text = "Save as bitmap...";
this.file_saveit.Click += new System.EventHandler(this.menuSaveAs);
//
// file_exit
//
this.file_exit.Index = 2;
this.file_exit.Text = "Exit";
this.file_exit.Click += new System.EventHandler(this.file_exit_Click);
//
// menuItem2
//
this.menuItem2.Index = 1;
this.menuItem2.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuCopy});
this.menuItem2.Text = "&Edit";
//
// menuCopy
//
this.menuCopy.Index = 0;
this.menuCopy.Shortcut = System.Windows.Forms.Shortcut.CtrlC;
this.menuCopy.Text = "&Copy";
this.menuCopy.Click += new System.EventHandler(this.menuCopyIt);
//
// menuItem3
//
this.menuItem3.Index = 2;
this.menuItem3.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menu_Zooms,
this.menuSmooth,
this.menu_Colours,
this.menu_Mosaics,
this.menuToggleHeader});
this.menuItem3.Text = "&View";
//
// menu_Zooms
//
this.menu_Zooms.Index = 0;
this.menu_Zooms.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.z_bestfit,
this.z_50,
this.z_100,
this.z_150,
this.z_200});
this.menu_Zooms.Text = "Zoom";
//
// z_bestfit
//
this.z_bestfit.Index = 0;
this.z_bestfit.Text = "Best fit";
this.z_bestfit.Click += new System.EventHandler(this.some_zoom_menu_selected);
//
// z_50
//
this.z_50.Index = 1;
this.z_50.Text = "50%";
this.z_50.Click += new System.EventHandler(this.some_zoom_menu_selected);
//
// z_100
//
this.z_100.Checked = true;
this.z_100.Index = 2;
this.z_100.Text = "100%";
this.z_100.Click += new System.EventHandler(this.some_zoom_menu_selected);
//
// z_150
//
this.z_150.Index = 3;
this.z_150.Text = "150%";
this.z_150.Click += new System.EventHandler(this.some_zoom_menu_selected);
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -