Exemplo n.º 1
0
 public ScreenMetrics(ZSize fontSize, ZSize windowSize, int rows, int columns, int scale)
 {
     FontSize   = fontSize;
     WindowSize = windowSize;
     Rows       = rows;
     Columns    = columns;
     Scale      = scale;
 }
Exemplo n.º 2
0
        /*
         * os_picture_data
         *
         * Return true if the given picture is available. If so, store the
         * picture width and height in the appropriate variables. Picture
         * number 0 is a special case: Write the highest legal picture number
         * and the picture file release number into the height and width
         * variables respectively when this picture number is asked for.
         *
         */
        public static bool picture_data(int picture, out int height, out int width)
        {
            if (_blorbFile != null)
            {
                if (picture == 0)
                {
                    height = -1;
                    width  = -_blorbFile.ReleaseNumber;
                    foreach (var p in _blorbFile.Pictures.Keys)
                    {
                        if (p > height)
                        {
                            height = p;
                            width  = _blorbFile.ReleaseNumber;
                        }
                    }

                    return(true);
                }
                else
                {
                    byte[] buffer = _blorbFile.Pictures[picture].Image;
                    if (buffer.Length == 8)
                    { // TODO This is a bit of a hack, it would be better to handle this upfront so there is no guess work
                        width  = (int)makeid(buffer, 0) * _metrics.Scale;
                        height = (int)makeid(buffer, 4) * _metrics.Scale;
                    }
                    else
                    {
                        ZSize size = _screen.GetImageInfo(buffer);
                        height = size.Height;
                        width  = size.Width;
                    }

                    return(true);
                }
            }
            height = 0;
            width  = 0;
            return(false);
        }
Exemplo n.º 3
0
 public override void GenerateHash( )
 {
     base.GenerateHash();
     this.GeometryHash += GetMd5FromObject(BasePlane.ToJson() + XSize.ToJson() + YSize.ToJson() + ZSize.ToJson());
     this.Hash          = GetMd5FromObject(this);
 }