Example #1
0
        public Size GetTrueSize(int index)
        {
            if (!_initialized)
            {
                Initialize();
            }

            if (_images == null || index < 0 || index >= _images.Length)
            {
                return(Size.Empty);
            }

            if (_images[index] == null)
            {
                _fStream.Position = _indexList[index];
                _images[index]    = new MImage(_reader);
            }
            MImage mi = _images[index];

            if (mi.TrueSize.IsEmpty)
            {
                if (!mi.TextureValid)
                {
                    if ((mi.Width == 0) || (mi.Height == 0))
                    {
                        return(Size.Empty);
                    }

                    _fStream.Seek(_indexList[index] + 17, SeekOrigin.Begin);
                    mi.CreateTexture(_reader);
                }
                return(mi.GetTrueSize());
            }
            return(mi.TrueSize);
        }
Example #2
0
        private bool CheckImage(int index)
        {
            if (!_initialized)
            {
                Initialize();
            }

            if (_images == null || index < 0 || index >= _images.Length)
            {
                return(false);
            }


            if (_images[index] == null)
            {
                _fStream.Position = _indexList[index];
                _images[index]    = new MImage(_reader);
            }
            MImage mi = _images[index];

            if (!mi.TextureValid)
            {
                if ((mi.Width == 0) || (mi.Height == 0))
                {
                    return(false);
                }
                _fStream.Seek(_indexList[index] + 17, SeekOrigin.Begin);
                mi.CreateTexture(_reader);
            }

            return(true);
        }