コード例 #1
0
ファイル: ZPlaneDecoder.cs プロジェクト: ZePilOt/scummeditor
        public Bitmap Decode(RoomBlock roomBlock, int objectIndex, int imageIndex, int zPlaneIndex)
        {
            var obj = roomBlock.GetOBIMs()[objectIndex];

            ObjectImageHeader IMHD = obj.GetIMHD();

            _width  = IMHD.Width;
            _height = IMHD.Height;
            _zPlane = obj.GetIMxx()[imageIndex].GetZPlanes()[zPlaneIndex];

            Decode();

            return(_resultBitmap);
        }
コード例 #2
0
        public void Encode(RoomBlock blockToEncode, int objectIndex, int imageIndex, Bitmap imageToEncode, int zPlaneIndex)
        {
            var obj = blockToEncode.GetOBIMs()[objectIndex];

            _imageToEncode = imageToEncode;

            ObjectImageHeader IMHD = obj.GetIMHD();

            _width  = IMHD.Width;
            _height = IMHD.Height;
            _zPlane = obj.GetIMxx()[imageIndex].GetZPlanes()[zPlaneIndex];

            Encode();
        }
コード例 #3
0
ファイル: ImageEncoder.cs プロジェクト: ZePilOt/scummeditor
        public void Encode(RoomBlock blockToEncode, int objectIndex, int imageIndex, Bitmap imageToEncode)
        {
            var obj = blockToEncode.GetOBIMs()[objectIndex];

            _imageToEncode = imageToEncode;

            ObjectImageHeader IMHD = obj.GetIMHD();

            _width        = IMHD.Width;
            _height       = IMHD.Height;
            _transparency = blockToEncode.GetTRNS().Value;
            _strips       = obj.GetIMxx()[imageIndex].GetSMAP();
            if (PaletteIndex == 0)
            {
                _pallete = blockToEncode.GetDefaultPalette();
            }
            else
            {
                _pallete = blockToEncode.GetPALS().GetWRAP().GetAPALs()[PaletteIndex];
            }
            Encode();
        }
コード例 #4
0
        public override void SetAndRefreshData(Structures.BlockBase blockBase)
        {
            base.SetAndRefreshData(blockBase);

            _objectImageHeader = (ObjectImageHeader)blockBase;

            Id.Text             = _objectImageHeader.Id.ToString();
            LocationHeigth.Text = _objectImageHeader.Height.ToString();
            LocationWidth.Text  = _objectImageHeader.Width.ToString();
            NumHotspots.Text    = _objectImageHeader.NumHotspots.ToString();
            NumImages.Text      = _objectImageHeader.NumImages.ToString();
            NumZPlanes.Text     = _objectImageHeader.NumZPlanes.ToString();
            Unknown.Text        = _objectImageHeader.Unknown.ToString();
            LocationX.Text      = _objectImageHeader.X.ToString();
            LocationY.Text      = _objectImageHeader.Y.ToString();

            Hotspots.Items.Clear();
            foreach (Hotspot hotspot in _objectImageHeader.Hotspots)
            {
                ListViewItem item = Hotspots.Items.Add(hotspot.X.ToString());
                item.SubItems.Add(hotspot.Y.ToString());
            }
        }