コード例 #1
0
 public static byte[] BitmapToTileMapped(Bitmap image, BGR565 pal, TileMapType tileMap, ColorDepth colorDepth)
 {
     if (!_isConvertersInitialized)
     {
         InitilizeConverters();
     }
     byte[] alphaValues         = null;
     byte[] uncompressedIndexes = ImageTypeConverter.GenerateTiledIndices(image, pal, tileMap, true);
     return(_indexedFormatConverters[colorDepth].CompressIndexes(uncompressedIndexes));
 }
コード例 #2
0
        public static byte[] BitmapToRawIndexed(Bitmap image, BGR565 pal, TileMode tileMode, ColorDepth colorDepth)
        {
            if (!_isConvertersInitialized)
            {
                InitilizeConverters();
            }
            byte[] alphaValues = null;
            byte[] uncompressedIndexes;

            if (tileMode == TileMode.Tiled)
            {
                uncompressedIndexes = ImageTypeConverter.GenerateTiledIndices(image, pal, null, false);
            }
            else
            {
                uncompressedIndexes = ImageTypeConverter.GenerateNotTiledToBmp(image, pal);
            }

            byte[] indexes = _indexedFormatConverters[colorDepth].CompressIndexes(uncompressedIndexes);
            return(indexes);
        }