Ejemplo n.º 1
0
        public void ImportaNCGRComNscr(string dirImg)
        {
            ColorDepth  depth         = Char.IntensidadeDeBits == 3 ? ColorDepth.F4BBP : ColorDepth.F8BBP;
            BGR565      palette       = new BGR565(ArquivoNclr.Pltt.Paleta);
            TileMapType tilemap       = new TileMapType();
            Bitmap      imageToInsert = new Bitmap(dirImg);

            if (imageToInsert.Width > ArquivoNscr.Scrn.Largura)
            {
                Errors.Add("A largura da imagem importada é maior que a original");
            }

            if (imageToInsert.Height > ArquivoNscr.Scrn.Altura)
            {
                Errors.Add("A altura da imagem importada é maior que a original");
            }

            if (Errors.Count == 0)
            {
                Char.Tiles = ImageConverter.BitmapToTileMapped(imageToInsert, palette, tilemap, depth);
                ArquivoNscr.Scrn.InfoTela = tilemap.Tilemap.ToArray();
                CarregarImagemNCGRComNSCR();
            }
        }