private void picBorder_MouseHandle(object sender, MouseEventArgs e) { int x = e.X / TileSize; int y = e.Y / TileSize; if (e.Button != MouseButtons.Left) { return; } if (e.X < 0 || e.X >= (picBorder.Width - 2) || e.Y < 0 || e.Y >= (picBorder.Height - 2)) { return; } int OtherBit = CurrentMap.BorderData[x, y] & 0xFC00; CurrentMap.BorderData[x, y] = (ushort)(OtherBit | CurrentTile & 0x3FF); Rectangle DestRect = new Rectangle(x * TileSize, y * TileSize, TileSize, TileSize); Rectangle SrcRect = new Rectangle((CurrentTile % 8) * TileSize, (CurrentTile / 8) * TileSize, TileSize, TileSize); BorderGraphics.DrawImage(TilesetImage, DestRect, SrcRect, GraphicsUnit.Pixel); picBorder.Invalidate(); }
public CrossPlatformBorderXF() { _thisDraw = new SKCanvasView(); _thisDraw.PaintSurface += DrawPaint; _thisBorder = new BorderGraphics(this); //forgot Content = _thisDraw; }
public CrossPlatformBorderWPF() { _thisDraw = new SKElement(); _thisBorder = new BorderGraphics(this); //maybe this was correct. Content = _thisDraw; // try this. _thisDraw.PaintSurface += ThisDraw_PaintSurface; }