Click here to Skip to main content
15,896,154 members
Articles / Programming Languages / C#

Convert the image to float[][][]/float[][,]/T[][][]/T[][,] data , fast and safety

Rate me:
Please Sign up or sign in to vote.
4.56/5 (18 votes)
18 May 2012CPOL4 min read 205.3K   1.9K   32  
I support a group methods to load the image to double[,]/double[][,]/T[][,], that could help to manipulate the image
namespace DoubleToImageDemo
{
    partial class Form1
    {
        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

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

        /// <summary>
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.btnSaveBinaryFile = new System.Windows.Forms.Button();
            this.btnLoadImg = new System.Windows.Forms.Button();
            this.btnLoadBinaryData = new System.Windows.Forms.Button();
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            this.SuspendLayout();
            // 
            // btnSaveBinaryFile
            // 
            this.btnSaveBinaryFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnSaveBinaryFile.Location = new System.Drawing.Point(427, 98);
            this.btnSaveBinaryFile.Name = "btnSaveBinaryFile";
            this.btnSaveBinaryFile.Size = new System.Drawing.Size(135, 21);
            this.btnSaveBinaryFile.TabIndex = 7;
            this.btnSaveBinaryFile.Text = "Save as Binary File";
            this.btnSaveBinaryFile.UseVisualStyleBackColor = true;
            this.btnSaveBinaryFile.Click += new System.EventHandler(this.btnSaveBinaryFile_Click);
            // 
            // btnLoadImg
            // 
            this.btnLoadImg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnLoadImg.Location = new System.Drawing.Point(427, 12);
            this.btnLoadImg.Name = "btnLoadImg";
            this.btnLoadImg.Size = new System.Drawing.Size(135, 21);
            this.btnLoadImg.TabIndex = 6;
            this.btnLoadImg.Text = "Load Image File";
            this.btnLoadImg.UseVisualStyleBackColor = true;
            this.btnLoadImg.Click += new System.EventHandler(this.btnLoadImg_Click);
            // 
            // btnLoadBinaryData
            // 
            this.btnLoadBinaryData.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnLoadBinaryData.Location = new System.Drawing.Point(427, 71);
            this.btnLoadBinaryData.Name = "btnLoadBinaryData";
            this.btnLoadBinaryData.Size = new System.Drawing.Size(135, 21);
            this.btnLoadBinaryData.TabIndex = 5;
            this.btnLoadBinaryData.Text = "Load Binary File";
            this.btnLoadBinaryData.UseVisualStyleBackColor = true;
            this.btnLoadBinaryData.Click += new System.EventHandler(this.btnLoadBinaryData_Click);
            // 
            // pictureBox1
            // 
            this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
            | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.pictureBox1.Location = new System.Drawing.Point(12, 12);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(409, 236);
            this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
            this.pictureBox1.TabIndex = 4;
            this.pictureBox1.TabStop = false;
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(571, 260);
            this.Controls.Add(this.btnSaveBinaryFile);
            this.Controls.Add(this.btnLoadImg);
            this.Controls.Add(this.btnLoadBinaryData);
            this.Controls.Add(this.pictureBox1);
            this.Name = "Form1";
            this.Text = "Form1";
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Button btnSaveBinaryFile;
        private System.Windows.Forms.Button btnLoadImg;
        private System.Windows.Forms.Button btnLoadBinaryData;
        private System.Windows.Forms.PictureBox pictureBox1;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
China China
Satellites' Image Processing
Include:
Imaging Progress Simulation
Multispectral Image Processing
Distributed System

Comments and Discussions