GetBytesFromBitmapSource() private method

private GetBytesFromBitmapSource ( System.Windows.Media.Imaging.BitmapSource bmp ) : byte[]
bmp System.Windows.Media.Imaging.BitmapSource
return byte[]
Exemplo n.º 1
0
        public static bool AreImageSourcesEqual(ImageSource left, ImageSource right)
        {
            if (left == null)
            {
                return(right == null);
            }
            if (right == null)
            {
                return(false);
            }
            BitmapSource bitmapSource  = Utility.GenerateBitmapSource(left);
            BitmapSource bitmapSource1 = Utility.GenerateBitmapSource(right);

            byte[] bytesFromBitmapSource = Utility.GetBytesFromBitmapSource(bitmapSource);
            byte[] numArray = Utility.GetBytesFromBitmapSource(bitmapSource1);
            if ((int)bytesFromBitmapSource.Length != (int)numArray.Length)
            {
                return(false);
            }
            return(Utility.MemCmp(bytesFromBitmapSource, numArray, (int)bytesFromBitmapSource.Length));
        }