Example #1
0
        // non-allocation image generator
        public static Bitmap GetBitmapItemLayerViewGrid(ItemLayer layer, int x0, int y0, int scale, int[] acre1, int[] acreScale, Bitmap dest, int transparency = -1, int gridlineColor = 0)
        {
            var w = layer.GridWidth;
            var h = layer.GridHeight;

            LoadPixelsFromLayer(layer, x0, y0, w, acre1);
            w *= scale;
            h *= scale;
            ImageUtil.ScalePixelImage(acre1, acreScale, w, h, scale);

            if (transparency >> 24 != 0xFF)
            {
                ImageUtil.ClampAllTransparencyTo(acreScale, transparency);
            }

            // draw symbols over special items now?
            DrawDirectionals(acreScale, layer, w, x0, y0, scale);

            // Slap on a grid
            DrawGrid(acreScale, w, h, scale, gridlineColor);

            // Return final data
            ImageUtil.SetBitmapData(dest, acreScale);
            return(dest);
        }
Example #2
0
 public static Bitmap GetBitmapItemLayer(ItemLayer layer, int x, int y, int[] data, Bitmap dest, int transparency = -1)
 {
     LoadBitmapLayer(layer.Tiles, data, layer.MaxWidth, layer.MaxHeight);
     if (transparency >> 24 != 0xFF)
     {
         ImageUtil.ClampAllTransparencyTo(data, transparency);
     }
     ImageUtil.SetBitmapData(dest, data);
     return(DrawViewReticle(dest, layer, x, y));
 }