本文整理汇总了C#中Map.DrawMap方法的典型用法代码示例。如果您正苦于以下问题:C# Map.DrawMap方法的具体用法?C# Map.DrawMap怎么用?C# Map.DrawMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map.DrawMap方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Game
public Game(Canvas canvas, BitmapImage unitImg, BitmapImage towerImg, BitmapImage bulletImg, BitmapImage roadImg)
{
this.gameCanvas = canvas;
this.unitImg = unitImg;
this.towerImg = towerImg;
this.roadImg = roadImg;
//tileHeight = Math.Max(this.unitImg.DecodePixelHeight, this.towerImg.DecodePixelHeight);
//tileWidth = Math.Max(this.unitImg.DecodePixelWidth, this.towerImg.DecodePixelWidth);
this.map = new Map((int)gameCanvas.Width, (int)canvas.Height, tileWidth, tileHeight);
InitPath();
this.bulletImg = bulletImg;
InitUnits();
InitTowers();
//map.DrawTiles(gameCanvas);
map.Images[ObjectType.Path] = this.roadImg;
map.DrawMap(gameCanvas);
map.DrawTiles(gameCanvas);
}
示例2: MapInfos
public MapInfos(Map CurrentMap, String ProjectName, String filename)
{
InitializeComponent();
map = CurrentMap;
PN_Title.BackgroundImage = new Bitmap(PN_Title.Width, PN_Title.Height);
using (XNAUtils utils = new XNAUtils())
using (Graphics g = Graphics.FromImage(PN_Title.BackgroundImage))
using (Brush brush = new SolidBrush(Color.Black))
using (Font bigfont = new Font("Calibri", 30))
using (Font smallfont = new Font("Calibri", 14))
{
g.DrawImage(utils.ConvertToImage(map.DrawMap()), new Point(0, 0));
g.DrawImage(Properties.Resources.FuzzyLineTitle, new Point(0,0));
g.DrawImage(Properties.Resources.AeroEffect, new Point(0, 0));
g.DrawString(map.Name, bigfont, brush, new Point(5, 5));
g.DrawString(ProjectName, smallfont, brush, new Point(25, 50));
PN_Title.Refresh();
NUM_X.Value = Convert.ToDecimal(map.MapSize.Width);
NUM_Y.Value = Convert.ToDecimal(map.MapSize.Height);
TB_Rename.Text = map.Name;
PB_Tileset.Image = utils.ConvertToImage(map.TileSet);
PB_Tileset.Size = PB_Tileset.Image.Size;
FileInfo info = new FileInfo(filename);
LB_Filename.Text = info.Name;
LB_Filesize.Text = (info.Length / 1024) + "ko";
}
this.Text += " - " + map.Name;
}
示例3: DrawLimits
public DrawLimits(Map map)
{
InitializeComponent();
this.map = map;
using (XNAUtils utils = new XNAUtils())
{
PN_Map.BackgroundImage = utils.ConvertToImage(map.DrawMap());
PN_Map.Size = new Size(map.MapSize.Width * 32, map.MapSize.Height * 32);
Buffer = new Bitmap(PN_Map.Size.Width, PN_Map.Size.Height);
using (Graphics g = Graphics.FromImage(Buffer))
{
g.Clear(Color.White);
if (map.Limits != null) g.DrawImage(utils.ConvertToImage(map.Limits), new Point(0, 0));
}
Buffer.MakeTransparent(Color.White);
Brushsize = 10;
Brushtype = BrushType.Circle;
brushcolor = Color.Black;
}
}
示例4: DrawMap
private MemoryStream DrawMap(Map diMap)
{
MemoryStream RetVal = new MemoryStream();
Bitmap bmp = new Bitmap(Convert.ToInt32(diMap.Width), Convert.ToInt32(diMap.Height));
diMap.DrawMap(string.Empty, Graphics.FromImage(bmp));
bmp.Save(RetVal, ImageFormat.Png);
return RetVal;
}
示例5: GenerateMap
public Texture2D GenerateMap(Texture2D tileset)
{
Map map = new Map(tiles, tileset);
return map.DrawMap();
}