I'm doing a project and I'm capturing frames from kinect and do some real-time process on them, I need to display bitmaps so I'm converting them to bmapsource and pass to image.source:
Bitmap bmap = new Bitmap(640, 480, System.Drawing.Imaging.PixelFormat
.Format24bppRgb);
BitmapSource bmapSource= System.Windows.Interop.Imaging.
CreateBitmapSourceFromHBitmap(bmap.GetHbitmap(),IntPtr.Zero, Int32Rect.Empty,
BitmapSizeOptions.FromEmptyOptions());
image.source = bmapSource;
But as I'm processing 15FPS after 2 minute I get the error "Out of memory" for this part. Is there anyway to clear the memory after each process? or isthere any other way to display the bmap in wpf?
Thanks in advance :)