Closed codediy closed 2 years ago
when use the export tiles bmp in Tiled ,it is so long,and not beautiful
so change export bmp as 16x16 bmp
//MainForm.cs export_tiles_blocks_data // draw images into bitmap 16x16 // width : 16*_data_size // height : Math.Ceiling(num_active_tiles/16) var bmpWidth = 16 * _data_size; var bmpHeight = (int)Math.Ceiling((float)num_active_tiles / 16) * _data_size; Bitmap bmp = new Bitmap(bmpWidth, bmpHeight); // Bitmap bmp = new Bitmap( _data_size * num_active_tiles, _data_size );//, PixelFormat.Format24bppRgb ); Graphics gfx = Graphics.FromImage( bmp ); gfx.InterpolationMode = InterpolationMode.NearestNeighbor; gfx.PixelOffsetMode = PixelOffsetMode.HighQuality; for( i = 0; i < num_active_tiles; i++ ) { // gfx.DrawImage( _image_list.Images[ i ], i * _data_size, 0, _data_size, _data_size ); var x = i % 16; var y = (int) Math.Floor((float)i / 16); gfx.DrawImage(_image_list.Images[i], x * _data_size, y * _data_size, _data_size, _data_size); }
Done! Thanks for the suggestion. Compiled binaries in the development build.
when use the export tiles bmp in Tiled ,it is so long,and not beautiful
so change export bmp as 16x16 bmp