Ejemplo n.º 1
0
        public void Validate()
        {
            bmpHeader.VerifyFileSignature();
            imageHeader.Validate();

            VerifyIndexedPaletteSizeDoesNotExceedBitCount();
            VerifyPixelSizeMatchesImageDimensionsWithPitch();
        }
Ejemplo n.º 2
0
        // Read
        private static BmpHeader ReadBmpHeader(BinaryReader seekableReader)
        {
            BmpHeader bmpHeader = new BmpHeader(seekableReader);

            bmpHeader.VerifyFileSignature();

            if (bmpHeader.size < seekableReader.BaseStream.Length)
            {
                throw new System.Exception("Bitmap file size exceed length of stream.");
            }

            return(bmpHeader);
        }