Example #1
0
        private void BTN_New_Click(object sender, EventArgs e)
        {
            FRM_New nouveau = new FRM_New();

            nouveau.ShowDialog();
            if (nouveau.DialogResult == DialogResult.OK)
            {
                this.Visible = false;
                FRM_Main main = new FRM_Main(nouveau.CanvasWidth, nouveau.CanvasHeight);
                main.ShowDialog();
                this.Close();
            }
        }
Example #2
0
        private void NewFile()
        {
            bool New = true;

            if (FileChanged)
            {
                DialogResult result = PromptSave();
                if (result == DialogResult.Yes)
                {
                    result = SaveFileAs();
                    New    = (result == DialogResult.OK);
                }
                else
                {
                    New = (result != DialogResult.Cancel);
                }
            }
            if (New)
            {
                FRM_New nouveau = new FRM_New();
                nouveau.ShowDialog();
                if (nouveau.DialogResult == DialogResult.OK)
                {
                    Bitmap NewSprite = new Bitmap(nouveau.CanvasWidth, nouveau.CanvasHeight);

                    //Set all pixels transparent
                    for (int i = 0; i < NewSprite.Height; i++)
                    {
                        for (int j = 0; j < NewSprite.Width; j++)
                        {
                            NewSprite.SetPixel(j, i, Color.FromArgb(0, 0, 0, 0));
                        }
                    }

                    FileName = "";
                    LoadImage(NewSprite);
                }
            }
        }