123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using System;
- using System.Drawing;
- using bbiwarg.DataSource;
- namespace bbiwarg.Test
- {
- class TestDataSource
- {
- static void Main(string[] args)
- {
- IVideoDataSource source = new IIsuDataSource("..\\..\\videos\\2.skv");
- source.init();
- source.start();
- int i = 0;
- int j = 0;
- while (source.isActive())
- {
- source.updateFrame();
- if ((i % 30) == 0)
- {
- ColorImage image = source.getColorImage();
- Bitmap bm = new Bitmap(image.getWidth(), image.getHeight());
- for (int x = 0; x < image.getWidth(); ++x)
- {
- for (int y = 0; y < image.getHeight(); ++y)
- {
- bm.SetPixel(x, y, Color.FromArgb(image.getA(x, y), image.getR(x, y), image.getG(x, y), image.getB(x, y)));
- }
- }
- bm.Save("test." + j + ".png");
- j++;
- }
- source.releaseFrame();
- ++i;
- }
- source.stop();
- }
- }
- }
|