// non-allocation image generator public static Bitmap GetBitmapLayerAcre(FieldItemLayer layer, int x0, int y0, int scale, int[] acre1, int[] acreScale, Bitmap dest, int transparency = -1) { 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.SetAllTransparencyTo(acreScale, transparency); } // draw symbols over special items now? DrawDirectionals(acreScale, layer, w, x0, y0, scale); // Slap on a grid DrawGrid(acreScale, w, h, scale); // Return final data ImageUtil.SetBitmapData(dest, acreScale); return(dest); }
public static Bitmap GetBitmapLayer(FieldItemLayer layer, int x, int y, int[] data, Bitmap dest, int transparency = -1) { LoadBitmapLayer(layer.Tiles, data, layer.MapWidth, layer.MapHeight); if (transparency >> 24 != 0xFF) { ImageUtil.SetAllTransparencyTo(data, transparency); } ImageUtil.SetBitmapData(dest, data); return(DrawViewReticle(dest, layer, x, y)); }