日期:2014-05-18  浏览次数:20809 次

一个现有摄像头图像捕捉程序的问题(100分在线等)
我是C#初学者,这里有一个程序运行出错请问是为什么?
这个程序的目的就是显示摄像头的图像,采集图片之类的
出错信息:
未处理的“System.Resources.MissingManifestResourceException”类型的异常出现在 mscorlib.dll 中。

其他信息: 未能找到任何适合于指定的区域性或非特定区域性的资源。请确保在编译时已将“CapTureMovie.Form1.resources”正确嵌入或链接到程序集“cstest”,或者确保所有需要的附属程序集都可加载并已进行了完全签名。

程序如下:

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Runtime.InteropServices;
using System.Drawing.Imaging;

namespace CapTureMovie
{
  /// <summary>  
  /// Form1 的摘要说明。  
  /// </summary>  
  public partial class Form1 : System.Windows.Forms.Form
  {
  private System.Windows.Forms.Button BtnCapTure;
  private System.Windows.Forms.Panel panel_Vedio;
  private int hHwnd;
  private System.Windows.Forms.Button BtnStop;
  private System.Windows.Forms.Label LbSysMsg;
  private System.Windows.Forms.Button button1;

  public struct videohdr_tag
  {
  public byte[] lpData;
  public int dwBufferLength;
  public int dwBytesUsed;
  public int dwTimeCaptured;
  public int dwUser;
  public int dwFlags;
  public int[] dwReserved;

  }
  public delegate bool CallBack(int hwnd, int lParam);
  /// <summary>  
  /// 必需的设计器变量。  
  /// </summary>  
  private System.ComponentModel.Container components = null;
  [DllImport("avicap32.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
  public static extern int capCreateCaptureWindowA([MarshalAs(UnmanagedType.VBByRefStr)] ref string lpszWindowName, int dwStyle, int x, int y, int nWidth, short nHeight, int hWndParent, int nID);
  [DllImport("avicap32.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
  public static extern bool capGetDriverDescriptionA(short wDriver, [MarshalAs(UnmanagedType.VBByRefStr)] ref string lpszName, int cbName, [MarshalAs(UnmanagedType.VBByRefStr)] ref string lpszVer, int cbVer);
  [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
  public static extern bool DestroyWindow(int hndw);
  [DllImport("user32", EntryPoint = "SendMessageA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
  public static extern int SendMessage(int hwnd, int wMsg, int wParam, [MarshalAs(UnmanagedType.AsAny)] object lParam);
  [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
  public static extern int SetWindowPos(int hwnd, int hWndInsertAfter, int x, int y, int cx, int cy, int wFlags);
  [DllImport("vfw32.dll")]
  public static extern string capVideoStreamCallback(int hwnd, videohdr_tag videohdr_tag);
  [DllImport("vicap32.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
  public static extern bool capSetCallbackOnFrame(int hwnd, string s);

  public Form1()
  {
  //  
  // Windows 窗体设计器支持所必需的  
  //  
  InitializeComponent();