Free Source code for image extraction

by barkkathulla 2012-09-19 11:23:46

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;

namespace Bluetooth
{
public partial class Form1 : Form
{
static string result;

public Form1()
{
InitializeComponent();
}
static string ConvertStringArrayToString(string[] array)
{
//
// Concatenate all the elements into a StringBuilder.
//
StringBuilder builder = new StringBuilder();
foreach (string value in array)
{
builder.Append(value);
//builder.Append('.');
}
return builder.ToString();
}

private void timer1_Tick(object sender, EventArgs e)
{
try
{
string[] array = Directory.GetFiles(@"C:\Output\ ");
result = ConvertStringArrayToString(array);

foreach (string name in array)
{
int count = name.Length;

string aa, bb;
aa = name.Remove(0, 60);
bb = Path.ChangeExtension(aa, null);
textBox1.Text = bb;

Execute();

}
File.Delete(Convert.ToString(result));
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void Form1_Load(object sender, EventArgs e)
{
label3.Visible = false;
timer1.Enabled = true;
timer1.Interval = 20000;


}

private void button1_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Are You Sure Want to Close the Application .?", "Application Closed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
Application.Exit();
}
else
{

}
}

}
serialPort1.PortName = "COM1";
serialPort1.BaudRate = 9600;
serialPort1.DataBits = 8;
serialPort1.Parity = Parity.None;
serialPort1.StopBits = StopBits.One;

if (serialPort1.IsOpen == true)
{
//
}
else
{
serialPort1.Open();
}
//serialPort1.buffer
serialPort1.DiscardInBuffer();
serialPort1.DiscardOutBuffer();
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;

/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (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();
this.textBox1 = new System.Windows.Forms.TextBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(375, 131);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(259, 20);
this.textBox1.TabIndex = 2;
//
// timer1
//
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Font = new System.Drawing.Font("Times New Roman", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(174, 36);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(495, 32);
this.label1.TabIndex = 3;
this.label1.Text = "PC CONTROL USING BLUETOOTH";
//
// label2
//
this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.Color.Transparent;
this.label2.Font = new System.Drawing.Font("Times New Roman", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(176, 131);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(173, 22);
this.label2.TabIndex = 4;
this.label2.Text = "Received Command";
//
// label3
//
this.label3.AutoSize = true;
this.label3.BackColor = System.Drawing.Color.Transparent;
this.label3.Font = new System.Drawing.Font("Times New Roman", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label3.ForeColor = System.Drawing.Color.Red;
this.label3.Location = new System.Drawing.Point(379, 179);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(49, 19);
this.label3.TabIndex = 5;
this.label3.Text = "label3";
//
// button1
//
this.button1.Font = new System.Drawing.Font("Times New Roman", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button1.ForeColor = System.Drawing.Color.Red;
this.button1.Location = new System.Drawing.Point(730, 289);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(70, 27);
this.button1.TabIndex = 6;
this.button1.Text = "EXIT";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = global::Bluetooth.Properties.Resources.HP_Tablet_PC___Cityscape_Portrait;
this.ClientSize = new System.Drawing.Size(834, 347);
this.Controls.Add(this.button1);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox1);
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
this.PerformLayout();

}

#endregion

private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button button1;
}
798
like
0
dislike
0
mail
flag

You must LOGIN to add comments