Exemplo n.º 1
0
 public override bool Equals(object obj)
 {
     if (obj is HashObj)
     {
         HashObj hashObj = (HashObj)obj;
         return(weakRef.Target == hashObj.weakRef.Target);
     }
     return(false);
 }
Exemplo n.º 2
0
        public static byte[] GetImageBytes(Image image)
        {
            if (image == null)
            {
                return new byte[] {}
            }
            ;
            HashObj hashObj = HashObj.GetObj(image);

            byte[] bytes = (byte[])imageHT[hashObj];
            if (bytes == null)
            {
                bytes = ByteImageConverter.ToByteArray(image, ImageFormat.Png);

                imageHT[hashObj] = bytes;
            }
            return(bytes);
        }