Thumbnails/*
Description: Generates thumbnails according to the specified size
Author: blue.dream
*/
Using System;
Using System.Drawing;
Using System.Drawing.Imaging;
Using System.Collections;
Using System.ComponentModel;
Using System.Windows.Forms;
Using System.Data;
Using System.IO;
Namespace test
{
<summary>
Summary description of the Form1.
</summary>
public class Form1:System.Windows.Forms.Form
{
The number of digits that declare the random number generated by the cryptographic character
public const int LENGTH = 32;
To declare the length of the separation before and after the encrypted character
public const int LEN = 4;
Private System.Windows.Forms.GroupBox GroupBox1;
Private System.Windows.Forms.GroupBox GroupBox2;
Private System.Windows.Forms.Button Btn_browser;
Private System.Windows.Forms.Button button2;
Private System.Windows.Forms.PictureBox Imgsource;
Private System.Windows.Forms.PictureBox Imgobject;
private string sourcefile;
Private System.Windows.Forms.Label Label1;
Private System.Windows.Forms.ComboBox Local;
<summary>
The required designer variable.
</summary>
Private System.ComponentModel.Container components = null;
Public Form1 ()
{
//
Required for Windows Forms Designer support
//
InitializeComponent ();
This. Init ();
//
TODO: Add any constructor code after the InitializeComponent call
//
}
<summary>
Clean up all resources that are in use.
</summary>
protected override void Dispose (bool disposing)
{
if (disposing)
{
if (Components!= null)
{
Components. Dispose ();
}
}
Base. Dispose (disposing);
}
#region Windows Form Designer generated code
<summary>
Designer supports required methods-do not use the Code editor to modify
The contents of this method.
</summary>
private void InitializeComponent ()
{
This.groupbox1 = new System.Windows.Forms.GroupBox ();
This.imgsource = new System.Windows.Forms.PictureBox ();
This.groupbox2 = new System.Windows.Forms.GroupBox ();
This.imgobject = new System.Windows.Forms.PictureBox ();
This.btn_browser = new System.Windows.Forms.Button ();
This.button2 = new System.Windows.Forms.Button ();
this.local = new System.Windows.Forms.ComboBox ();
This.label1 = new System.Windows.Forms.Label ();
This.groupBox1.SuspendLayout ();
This.groupBox2.SuspendLayout ();
This. SuspendLayout ();
//
GroupBox1
//
This.groupBox1.Controls.AddRange (new system.windows.forms.control[] {
This.imgsource});
This.groupBox1.Name = "GroupBox1";
This.groupBox1.Size = new System.Drawing.Size (288, 296);
This.groupBox1.TabIndex = 0;
This.groupBox1.TabStop = false;
This.groupBox1.Text = "source Diagram";
//
Imgsource
//
This.imgSource.Location = new System.Drawing.Point (8, 16);
This.imgSource.Name = "Imgsource";
This.imgSource.Size = new System.Drawing.Size (272, 272);
This.imgSource.TabIndex = 0;
This.imgSource.TabStop = false;
//
GroupBox2
//
This.groupBox2.Controls.AddRange (new system.windows.forms.control[] {
This.imgobject});
This.groupBox2.Location = new System.Drawing.Point (304, 0);
This.groupBox2.Name = "GroupBox2";
This.groupBox2.Size = new System.Drawing.Size (352, 296);
This.groupBox2.TabIndex = 0;
This.groupBox2.TabStop = false;
This.groupBox2.Text = "Result graph";
//
Imgobject
//
This.imgObject.Location = new System.Drawing.Point (8, 16);
This.imgObject.Name = "Imgobject";
This.imgObject.Size = new System.Drawing.Size (336, 272);
This.imgObject.TabIndex = 0;
This.imgObject.TabStop = false;
//
Btn_browser
//
This.btn_Browser.Location = new System.Drawing.Point (24, 312);
This.btn_Browser.Name = "Btn_browser";
This.btn_Browser.TabIndex = 1;
This.btn_Browser.Text = "source Diagram";
This.btn_Browser.Click + = new System.EventHandler (This.btn_browser_click);
//
Button2
//
This.button2.Location = new System.Drawing.Point (552, 312);
This.button2.Name = "Button2";
This.button2.TabIndex = 2;
This.button2.Text = "Build";
This.button2.Click + = new System.EventHandler (This.button2_click);
//
Local
//
This.local.Location = new System.Drawing.Point (256, 312);
This.local.Name = "local";
This.local.Size = new System.Drawing.Size (112, 20);
This.local.TabIndex = 4;
This.local.Text = "-Please choose-";
//
Label1
//
This.label1.Location = new System.Drawing.Point (216, 312);
This.label1.Name = "Label1";
This.label1.Size = new System.Drawing.Size (32, 23);
This.label1.TabIndex = 6;
This.label1.Text = "Size";
This.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
Form1
//
This. AutoScaleBaseSize = new System.Drawing.Size (6, 14);
This. ClientSize = new System.Drawing.Size (664, 365);
This. Controls.AddRange (new system.windows.forms.control[] {
This.label1,
This.local,
This.button2,
This.btn_browser,
This.groupbox1,
This.groupbox2});
This. Name = "Form1";
This. Text = "Form1";
This.groupBox1.ResumeLayout (FALSE);
This.groupBox2.ResumeLayout (FALSE);
This. ResumeLayout (FALSE);
}
#endregion
<summary>
The main entry point for the application.
</summary>
[STAThread]
static void Main ()
{
Application.Run (New Form1 ());
}
private void Btn_browser_click (object sender, System.EventArgs e)
{
using (OpenFileDialog dlg = new OpenFileDialog ())
{
if (dlg. ShowDialog () = = DialogResult.OK)
{
string file = Dlg. FileName;
if (file.exists (File))
{
This. sourcefile = file;
Imgsource.image = new Bitmap (file);
}
}
Dlg. Dispose ();
}
}
private void Button2_Click (object sender, System.EventArgs e)
{
int select = (int) this.local.SelectedValue;
Point P = new Point (340,270);
Switch (SELECT)
{
Case 1:
p.x = 800;
P.Y = 600;
Break
Case 2:
p.x = 640;
P.Y = 480;
Break
Case 3:
p.x = 480;
P.Y = 360;
Break
Case 4:
P.Y = 340;
p.x = 270;
Break
Case 5:
p.x = 240;
P.Y = 180;
Break
Case 6:
p.x = 120;
P.Y = 90;
Break
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.