Accord.Video.AsyncVideoSource.CloneImage C# (CSharp) Method

CloneImage() private static method

private static CloneImage ( BitmapData sourceData ) : Bitmap
sourceData System.Drawing.Imaging.BitmapData
return System.Drawing.Bitmap
        private static Bitmap CloneImage(BitmapData sourceData)
        {
            // get source image size
            int width = sourceData.Width;
            int height = sourceData.Height;

            // create new image
            Bitmap destination = new Bitmap(width, height, sourceData.PixelFormat);

            // lock destination bitmap data
            BitmapData destinationData = destination.LockBits(
                new Rectangle(0, 0, width, height),
                ImageLockMode.ReadWrite, destination.PixelFormat);

            Accord.SystemTools.CopyUnmanagedMemory(destinationData.Scan0, sourceData.Scan0, height * sourceData.Stride);

            // unlock destination image
            destination.UnlockBits(destinationData);

            return destination;
        }
    }

Same methods

AsyncVideoSource::CloneImage ( Bitmap source ) : Bitmap