Umer Khan

Umer Khan

  • NA
  • 1
  • 0

C# : WebCamLib-Image in TextureLoader (as Texture)... Plz Help me...

Sep 3 2008 11:17 AM
Hello C-Sharp-Understanders,

I do build a openGL-Mesh in C# (a plane), and do apply a texture to it. Now I want to apply a live webcam image as a texture (at 30fps) to this openGL-Mesh.

This is what I do now (it doesn´t work :), using the "WebCamLib"-Library :

               WebCamLib.Device d = DeviceManager.GetDevice(1);
                d.ShowWindow(this.pictureBox1);
                //Stream imgStream = new System.IO.Stream("C:\\foo.jpg");
                FileStream imgStream = File.Create("C:\\foo.jpg");
                pictureBox1.Image.Save(imgStream,System.Drawing.Imaging.ImageFormat.Jpeg);
                System.Drawing.Bitmap bm = (Bitmap)Bitmap.FromStream(imgStream);
                //System.Drawing.Bitmap bm = (Bitmap)Bitmap.FromHbitmap(this.pictureBox1.Image);
                backgroundtexture = TextureLoader.FromStream(device, imgStream);

Please help me. Thanks in advance.

Greetings,
Fxworker