TestDataSource.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Drawing;
  3. using bbiwarg.DataSource;
  4. namespace Test.bbiwarg
  5. {
  6. class TestDataSource
  7. {
  8. static void Main(string[] args)
  9. {
  10. IVideoDataSource source = new IIsuDataSource("..\\..\\videos\\2.skv");
  11. source.init();
  12. source.start();
  13. int i = 0;
  14. int j = 0;
  15. while (source.isActive())
  16. {
  17. source.updateFrame();
  18. if ((i % 30) == 0)
  19. {
  20. ColorImage image = source.getColorImage();
  21. /*Bitmap bm = new Bitmap(image.getWidth(), image.getHeight());
  22. for (int x = 0; x < image.getWidth(); ++x)
  23. {
  24. for (int y = 0; y < image.getHeight(); ++y)
  25. {
  26. int value = (int) (image.getDepth(x, y) / 1000.0 * 255.0) % 256;
  27. bm.SetPixel(x, y, Color.FromArgb(255, value, value, value));
  28. }
  29. }
  30. bm.Save("test." + j + ".png");
  31. j++;*/
  32. }
  33. source.releaseFrame();
  34. ++i;
  35. }
  36. source.stop();
  37. }
  38. }
  39. }