Beispiel #1
0
 public static API_AForge_Video add_Image(this API_AForge_Video aforgeVideo, Bitmap image)
 {
     try
     {
         if (image.isNull())
         {
             return(aforgeVideo);
         }
         if (aforgeVideo.PathToAviVideo.isNull())
         {
             aforgeVideo.newVideo();
         }
         if (image.isNull())
         {
             return(aforgeVideo);
         }
         if (image.Width.neq(aforgeVideo.VideoWidth).or(
                 image.Height.neq(aforgeVideo.VideoHeight)))
         {
             image = image.resize(aforgeVideo.VideoWidth, aforgeVideo.VideoHeight);
         }
         aforgeVideo.VideoWriter.AddFrame(image);
     }
     catch (Exception ex)
     {
         ex.log("[API_AForge_Video] in add_Image");
     }
     return(aforgeVideo);
 }
Beispiel #2
0
 public static Bitmap capture(this API_AForge_Video aforgeVideo, Control staControl)
 {
     return((Bitmap)staControl.invokeOnThread(
                () => aforgeVideo.Cropper.capture(aforgeVideo.Desktop_Capture_Top,
                                                  aforgeVideo.Desktop_Capture_Left,
                                                  aforgeVideo.Desktop_Capture_Width,
                                                  aforgeVideo.Desktop_Capture_Height)));
 }
Beispiel #3
0
 public static API_AForge_Video add_Bitmaps(this API_AForge_Video aforgeVideo, List <Bitmap> bitmaps)
 {
     foreach (var bitmap in bitmaps)
     {
         aforgeVideo.add_Bitmap(bitmap);
     }
     return(aforgeVideo);
 }
Beispiel #4
0
 public static API_AForge_Video add_Images(this API_AForge_Video aforgeVideo, List <string> pathToImages)
 {
     foreach (var pathToImage in pathToImages)
     {
         aforgeVideo.add_Image(pathToImage);
     }
     return(aforgeVideo);
 }
Beispiel #5
0
 public static string createVideo(this API_AForge_Video aforgeVideo, List <string> pathToImages)
 {
     "Creating Video with {0} images".debug(pathToImages.size());
     aforgeVideo.newVideo();
     aforgeVideo.add_Images(pathToImages);
     aforgeVideo.saveAndClose();
     "Created Video: {0}".info(aforgeVideo.PathToAviVideo);
     return(aforgeVideo.PathToAviVideo);
 }
Beispiel #6
0
        public static string createVideo(this API_AForge_Video aforgeVideo, List <Bitmap> bitmaps)
        {
//			show.info(bitmaps);
            aforgeVideo.newVideo();
            aforgeVideo.add_Bitmaps(bitmaps);
            aforgeVideo.saveAndClose();
            "Created Video: {0}".info(aforgeVideo.PathToAviVideo);
            return(aforgeVideo.PathToAviVideo);
        }
Beispiel #7
0
 public ascx_MovieEditor()
 {
     FrameViewer_Panel               = this;
     AForge_Video                    = new API_AForge_Video();
     AForge_Video.FrameRate          = 3;
     AForge_Video.FrameCaptureDelay  = 10;
     AForge_Video.AddDuplicateFrames = false;
     OnImageDeleteAlsoDeleteFromDisk = false;
     ViewMultipleSelectedImages      = true;
 }
Beispiel #8
0
        public static string createAndPlay(this VideoSourcePlayer videoPlayer, List <string> pathToImages)
        {
            "in  VideoSourcePlayer createAndPlay, creating a video from {0} WPF images".info(pathToImages.size());
            var aforgeVideo = new API_AForge_Video();

            aforgeVideo.add_Images(pathToImages);
            aforgeVideo.saveAndClose();
            videoPlayer.play(aforgeVideo.PathToAviVideo);
            return(aforgeVideo.PathToAviVideo);
        }
Beispiel #9
0
 public static API_AForge_Video frameCaptureDelay(this API_AForge_Video aforgeVideo)
 {
     aforgeVideo.sleep(aforgeVideo.FrameCaptureDelay);
     return(aforgeVideo);
 }
Beispiel #10
0
 public static API_AForge_Video add_Bitmap(this API_AForge_Video aforgeVideo, Bitmap bitmap)
 {
     aforgeVideo.add_Image(bitmap);
     return(aforgeVideo);
 }
Beispiel #11
0
 public static API_AForge_Video add_Image(this API_AForge_Video aforgeVideo, string pathToImage)
 {
     aforgeVideo.add_Image(Misc_ExtensionMethods.bitmap(pathToImage));                           // using the extension methods creates a weird conflic with the other bitmap<T>() where T : Control
     return(aforgeVideo);
 }