public void refreshIndividual(Point pressCan, List <TileLayers> l, TiledImage i, bool drawgrid)
        {
            Point pressCanvas = new Point(pressCan.X * scale.X, pressCan.Y * scale.Y);

            g.DrawImage(clearedTile, pressCanvas);
            for (int a = 0; a < l.Count; a++)
            {
                g.DrawImage(img, pressCanvas.X, pressCanvas.Y, new Rectangle(i.getTilePoint(l[a].tileset[l[a].PointToTile(pressCan)]), new Size(scale)), units);
            }
            drawGrid(drawgrid);
            pb.Refresh();
        }
Example #2
0
        public TileForm2(Image img, Point input, Point output)
        {
            InitializeComponent();

            this.img = img;
            //scale canvas
            this.input       = input;
            this.output      = output;
            scale            = new Point(img.Width / input.X, img.Height / input.Y);
            this.Size        = new Size((output.X * scale.X) + 164 + 16, (output.Y * scale.Y) + 100);
            pictureBox1.Size = new Size(output.X * scale.X, output.Y * scale.Y);

            //construct picturebox
            p        = new PictureBox();
            p.Click += new EventHandler(clickimage);

            //bool fill event


            //construct objects
            t = new TiledImage(ref p, input, scale, img);
            t.drawGrid();
            c = new TilePaintingCanvas(ref pictureBox1, input, output, scale, img);
            c.drawGrid(grid);
            l = new List <TileLayers>();



            //construct click popup
            popup         = new ToolStripDropDown();
            popup.Margin  = Padding.Empty;
            popup.Padding = Padding.Empty;
            host          = new ToolStripControlHost(p);
            host.Margin   = Padding.Empty;
            host.Padding  = Padding.Empty;
            popup.Items.Add(host);
        }