示例#1
0
 private static void LoadBitmapLayer(Item[] items, int[] bmpData, int width, int height)
 {
     for (int x = 0; x < width; x++)
     {
         var ix = x * height;
         for (int y = 0; y < height; y++)
         {
             var index = ix + y;
             var tile  = items[index];
             bmpData[(y * width) + x] = FieldItemColor.GetItemColor(tile).ToArgb();
         }
     }
 }
示例#2
0
        private static void LoadPixelsFromLayer(ItemLayer layer, int x0, int y0, int width, int[] bmpData)
        {
            var stride = layer.GridWidth;

            for (int y = 0; y < stride; y++)
            {
                var baseIndex = (y * width);
                for (int x = 0; x < stride; x++)
                {
                    var tile  = layer.GetTile(x + x0, y + y0);
                    var color = FieldItemColor.GetItemColor(tile).ToArgb();
                    var index = baseIndex + x;
                    bmpData[index] = color;
                }
            }
        }