/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); _Font1 = Content.Load <SpriteFont>("SpriteFont1"); FilterCollection filters = new FilterCollection(FilterCategory.VideoInputDevice); if (filters.Count != 0) { _cam = new CaptureDevice(GraphicsDevice); _cam.VideoSource = filters[0].MonikerString; _cam.Start(); _cam.NewFrame += new CameraEventHandler(_cam_NewFrame); } _objectTex = _surf.InitToTexture(GraphicsDevice, "box2.png"); // TODO: use this.Content to load your game content here }
// Constructor public Grabber(CaptureDevice parent) { this.parent = parent; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); _Font1 = Content.Load<SpriteFont>("SpriteFont1"); FilterCollection filters = new FilterCollection(FilterCategory.VideoInputDevice); if( filters.Count != 0) { _cam = new CaptureDevice(GraphicsDevice); _cam.VideoSource = filters[0].MonikerString; _cam.Start(); _cam.NewFrame += new CameraEventHandler(_cam_NewFrame); } _objectTex = _surf.InitToTexture(GraphicsDevice, "box2.png"); // TODO: use this.Content to load your game content here }