Ejemplo n.º 1
0
        public bool Read(Envelope evp, int width, int height, ref Bitmap bitmap, bool isReBuildBuffer)
        {
            int offsetX = (int)((evp.MinX - _fullEnvelope.MinX) / _geoImage.ResolutionX);
            int offsetY = (int)((_fullEnvelope.MaxY - evp.MaxY) / _geoImage.ResolutionY);
            int w       = (int)(evp.Width / _geoImage.ResolutionX);
            int h       = (int)(evp.Height / _geoImage.ResolutionY);

            //if(isReBuildBuffer)
            BuildBuffer(width, height);
            bool isOK = _geoImage.ReadBlockData(1, offsetX, offsetY, w, h, _buffer, 0, width, height);

            if (isOK)
            {
                return((this as IRasterReader).BytesToBitmap(_buffer, width, height, _byteCountPerPixel, ref bitmap));
            }
            return(false);
        }