Windows ChallengE – ICOP Vortex86 and 1394 WebCam


You will be pleased to know that Starbucks in Taipei opened on time today, there’s nothing like a Grande Vanilla Latte to wake one up in the morning especially when you’re suffering with Jet Lag…


It’s time to answer a common inbound question – A number of teams in the Windows ChallengE are using the eBoxII reference board http://www.icop.com.tw/products_detail.asp?ProductID=132 and are wanting to hook up a webcam – the MSDN “Get Embedded“ article http://msdn.microsoft.com/library/en-us/dnembedded/html/embedded09172002.asp describes how to hook up a 1394 webcam to a CEPC to get this working – unfortunately, the Vortex86 reference board doesn’t have a PCI slot, so you can’t attach a 1394 webcam – the reference board does have USB connectors, so you could potentially hook up a USB WebCam, unfortunately Windows CE .NET 4.2 doesn’t ship with USB WebCam drivers – so, one way to get this working would be to use something like the eCAMIT IP camera from 3JTech – http://www.3jTech.com – you could pull images from the camera and display the output in a .NET Compact Framework application – the sample code below shows how to use the PictureBox control in a C# .NET Compact Framework application to display an image.


– Mike


using System;


using System.Drawing;


using System.Collections;


using System.Windows.Forms;


using System.Data;


namespace GetImage


{


/// <summary>


/// Summary description for Form1.


/// </summary>


public class Form1 : System.Windows.Forms.Form


{


private System.Windows.Forms.PictureBox pictureBox1;


private System.Windows.Forms.OpenFileDialog openFileDialog1;


private System.Windows.Forms.Button GetImage;



public Form1()


{


//


// 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 )


{


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.pictureBox1 = new System.Windows.Forms.PictureBox();


this.GetImage = new System.Windows.Forms.Button();


this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();


//


// pictureBox1


//


this.pictureBox1.Location = new System.Drawing.Point(8, 8);


this.pictureBox1.Size = new System.Drawing.Size(624, 328);


//


// GetImage


//


this.GetImage.Font = new System.Drawing.Font(“Tahoma”, 18F, System.Drawing.FontStyle.Regular);


this.GetImage.Location = new System.Drawing.Point(8, 344);


this.GetImage.Size = new System.Drawing.Size(616, 64);


this.GetImage.Text = “Get Image”;


this.GetImage.Click += new System.EventHandler(this.GetImage_Click);


//


// openFileDialog1


//


this.openFileDialog1.Filter = “Bitmaps|*.bmp”;


this.openFileDialog1.InitialDirectory = “\\Windows”;


//


// Form1


//


this.Controls.Add(this.GetImage);


this.Controls.Add(this.pictureBox1);


this.Text = “Form1”;


}


#endregion


/// <summary>


/// The main entry point for the application.


/// </summary>


static void Main()


{


Application.Run(new Form1());


}


private void GetImage_Click(object sender, System.EventArgs e)


{


if (DialogResult.OK == openFileDialog1.ShowDialog( )) {


pictureBox1.Image=new System.Drawing.Bitmap(openFileDialog1.FileName);


}


}


}


}


Comments (3)

  1. Mohamad , CSULB CE Challenge says:

    hi Mike,

    i tried to run this sample code

    in visual studio.net 2003 as a smart application

    (running on the sdk platform i created which supports .net framework)

    i had the follwoing error messages

    ——

    C:Documents and SettingsAdminMy DocumentsVisual Studio ProjectsSmartDeviceApplication1SmartDeviceApplication1.cs(27): The type or namespace name ‘Windows’ does not exist in the class or namespace ‘System’ (are you missing an assembly reference?)

    the same error message was repeated several times for Drawing, Data name spaces.

    what piece am i missing?

    i also tried to run a simple Hello world application on the my platform SDK Emulator, the project builds succesfully but when i try to run (deploy it)on my sdk Emulator i get an error message

    Error: Cannot establish a connection. Be sure the device is physically connected to the development computer.

    it runs great on the Windows Ce.net default emulator.

    your help is greatly appreciated

    Mohamad Arabo

    CSULB Team

  2. Mike says:

    Can you e-mail me your .CS file, or ZIP and mail me your project ? – I can then take a look at the issue… – my e-mail address is mikehall@microsoft.com

    Thanks,

    – Mike