public static ListView add_Video_Image_Wpf(this ListView listView, System.Drawing.Bitmap bitmap, int width, int height)
 {
     return((ListView)listView.wpfInvoke(
                () => {
         try
         {
             var videoImage = new API_AForge_Video_WPF_Image();
             videoImage._BitmapFile = bitmap.save();                                                     // I tried to use the bitmap here, but there was probs accessing it later
             videoImage.open(videoImage._BitmapFile);
             if (videoImage.isNull())
             {
                 return listView;
             }
             if (width > -1)
             {
                 videoImage.width_Wpf(width);
             }
             if (height > -1)
             {
                 videoImage.height_Wpf(height);
             }
             listView.add_Item(videoImage);
         }
         catch (Exception ex)
         {
             ex.log("in ListView add_Video_Image_Wpf");
         }
         return listView;
     }));
 }
        public static List <string> getBitmapsForVideoCreation(this API_AForge_Video_WPF_Image videoImage)
        {
            var bitmaps = new List <string>();

            for (int i = 0; i < videoImage._FrameCount; i++)
            {
                bitmaps.Add(videoImage._BitmapFile);
            }
            return(bitmaps);
        }
		public static ListView add_Video_Image_Wpf(this ListView listView, System.Drawing.Bitmap bitmap, int width, int height)
		{
			return (ListView)listView.wpfInvoke(
				()=>{					
						try
						{
							var videoImage = new API_AForge_Video_WPF_Image();							
							videoImage._BitmapFile = bitmap.save();			// I tried to use the bitmap here, but there was probs accessing it later
							videoImage.open(videoImage._BitmapFile);
							if (videoImage.isNull())
								return listView;	
							if (width > -1)
								videoImage.width_Wpf(width);
							if (height > -1)
								videoImage.height_Wpf(height);	
							listView.add_Item(videoImage);
						}
						catch(Exception ex)
						{
							ex.log("in ListView add_Video_Image_Wpf");
						}
						return listView;
					});
		}