public void paste() { if (!WindowsClipboard.IsImage) { return; } if (!bSelection) { return; } pr2.IRenderImage img = WindowsClipboard.getImage(); int tx = img.Width / 16; int ty = img.Height / 16; Selection s = originalSelection; this.selection = originalSelection.copy(); if (tx != s.width) { return; } if (ty != s.height) { return; } Operations.OperationManager om = Global.opManager; om.beginGroup("VSP Manager: Paste Tiledata"); Ops.SetTiledataGroup stdg = new Ops.SetTiledataGroup(Global.ActiveVsp); int y0 = s.y; int x0 = s.x; int[] arrImg = img.GetArray(); for (int y = 0; y < s.height; y++) { for (int x = 0; x < s.width; x++) { int t = (s.y + y) * TilesWide + s.x + x; stdg.addRecord(t, Global.Misc.sliceIntArrayImage(arrImg, img.Width, x * 16, y * 16, 16, 16)); } } om.add(stdg); om.endGroupExec(); img.Dispose(); Invalidate(); }
public VspObstructionTile Clone() { VspObstructionTile vot = new VspObstructionTile(parent, image.GetArray()); return(vot); }