Exemple #1
0
        private int getBitmapCount(int daxBlockId, string fileName)
        {
            // load 8x8 bitmaps from daxBlockId in fileName into the list bitmaps8x8 to simulate the order the bitmaps would be in memory in the game

            if (File.Exists(fileName) == false)
            {
                return(0);
            }
            var file = new DaxImageFile(string.Format(fileName));

            foreach (DaxFileBlock block in file.Blocks)
            {
                if (block.Id == daxBlockId)
                {
                    var parameters = new FileBlockParameters
                    {
                        Data = block.Data,
                        Name = block.File,
                        Id   = block.Id,
                    };

                    var render = new RenderBlockFactory().CreateUsing(parameters);

                    var x = render.GetBitmaps().Count();
                    return(x);
                }
            }

            return(0);
        }
        public IPlugin CreateUsing(PluginParameter args)
        {
            var filename = Path.GetFileName(args.Filename);
            var display35ImagesPerRow = filename != null && (filename.ToUpper().StartsWith("8X8D"));
            var displayBorder         = filename != null && filename.ToUpper().StartsWith("SPRIT");

            _file  = new DaxImageFile(args.Filename);
            Viewer = new DaxImageViewer(_file.GetBitmaps(), args.Zoom, args.ContainerWidth, display35ImagesPerRow, displayBorder, _file.GetBitmapIds(), _file);
            return(this);
        }
Exemple #3
0
        public IPlugin CreateUsing(PluginParameter args)
        {
            var filename = Path.GetFileName(args.Filename);
            var display35ImagesPerRow = filename != null && (filename.ToUpper().StartsWith("8X8D"));
            var displayBorder = filename != null && filename.ToUpper().StartsWith("SPRIT");

            _file = new DaxImageFile(args.Filename);
            Viewer = new DaxImageViewer(_file.GetBitmaps(), args.Zoom, args.ContainerWidth, display35ImagesPerRow, displayBorder, _file.GetBitmapIds());
            return this;
        }
Exemple #4
0
        static public DaxImageFile GetDaxImageFile(string filename)
        {
            DaxImageFile fc;

            if (filesCache.TryGetValue(filename, out fc))
            {
                return(fc);
            }
            fc = new DaxImageFile(filename);
            filesCache.Add(filename, fc);
            return(fc);
        }
Exemple #5
0
 public DaxImageViewer(IList <Bitmap> bitmaps, float zoom, int containerWidth, bool display35ImagesPerRow, bool displayBorder, IList <int> bitmapIds, DaxImageFile file)
 {
     Zoom                     = zoom;
     ContainerWidth           = containerWidth;
     _bitmaps                 = bitmaps;
     _bitmapIds               = bitmapIds;
     _display35ImagesPerRow   = display35ImagesPerRow;
     _displayBorder           = displayBorder;
     _rectanglesToIndex       = new Dictionary <RectangleF, int>();
     _pictureBox              = new PictureBox();
     _pictureBox.Paint       += PictureBoxPaint;
     _pictureBox.DoubleClick += PictureBoxDoubleClick;
     _file                    = file;
 }
Exemple #6
0
        private void loadBitmaps(int daxBlockId, string fileName, List <Bitmap> bitmaps8x8)
        {
            // load 8x8 bitmaps from daxBlockId in fileName into the list bitmaps8x8 to simulate the order the bitmaps would be in memory in the game
            var file = new DaxImageFile(string.Format(fileName));

            foreach (DaxFileBlock block in file.Blocks)
            {
                if (block.Id == daxBlockId)
                {
                    var parameters = new FileBlockParameters
                    {
                        Data = block.Data,
                        Name = block.File,
                        Id   = block.Id,
                    };
                    var render = new RenderBlockFactory().CreateUsing(parameters);
                    foreach (var bitmap in render.GetBitmaps())
                    {
                        bitmaps8x8.Add(bitmap);
                    }
                }
            }
        }
Exemple #7
0
        private void loadBitmaps(int daxBlockId, string fileName, List<Bitmap> bitmaps8x8)
        {
            // load 8x8 bitmaps from daxBlockId in fileName into the list bitmaps8x8 to simulate the order the bitmaps would be in memory in the game
            var file = new DaxImageFile(string.Format(fileName));
            foreach (DaxFileBlock block in file.Blocks)
            {

                if (block.Id == daxBlockId)
                {
                    var parameters = new FileBlockParameters
                    {
                        Data = block.Data,
                        Name = block.File,
                        Id = block.Id,
                    };
                    var render = new RenderBlockFactory().CreateUsing(parameters);
                    foreach (var bitmap in render.GetBitmaps())
                    {
                        bitmaps8x8.Add(bitmap);
                    }
                }
            }
        }
Exemple #8
0
        private int getBitmapCount(int daxBlockId, string fileName)
        {
            // load 8x8 bitmaps from daxBlockId in fileName into the list bitmaps8x8 to simulate the order the bitmaps would be in memory in the game

            if (File.Exists(fileName) == false) return 0;
            var file = new DaxImageFile(string.Format(fileName));
            foreach (DaxFileBlock block in file.Blocks)
            {

                if (block.Id == daxBlockId)
                {
                    var parameters = new FileBlockParameters
                    {
                        Data = block.Data,
                        Name = block.File,
                        Id = block.Id,
                    };

                    var render = new RenderBlockFactory().CreateUsing(parameters);

                    var x = render.GetBitmaps().Count();
                    return x;

                }
            }

            return 0;
        }