public override bool Equals(object obj) { if (obj is HashObj) { HashObj hashObj = (HashObj)obj; return(weakRef.Target == hashObj.weakRef.Target); } return(false); }
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); }