Example #1
0
        private void _8BitCanvas1_MouseMove(object sender, MouseEventArgs e)
        {
            if (nlbit == null)
            {
                return;
            }

            canv.lastClickX = e.X / canv.sidew;
            canv.lastClickY = e.Y / canv.sideh;



            if (toolid == TOOL_CLEAR && e.X >= 0 && e.X < canv.Width && e.Y >= 0 && e.Y < canv.Height)
            {
                using (Graphics g = canv.CreateGraphics())
                {
                    g.DrawEllipse(Pens.Black, (e.X - (brushsize * 4)), (e.Y - (brushsize * 4)), brushsize * 8, brushsize * 8);
                    canv.Refresh();
                }
            }


            int lx = canv.lastClickX;
            int ly = canv.lastClickY;

            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                if (toolid == TOOL_PENCIL)
                {
                    if (lx >= 0 && lx < 32 && ly >= 0 && ly < 32)
                    {
                        nlbit.falseColor.SetPixel(lx, ly, Color.FromArgb(brushindex));
                    }
                }



                if (toolid == TOOL_CLEAR)
                {
                    if (curPen != null)
                    {
                        //nlbit.falseColor.SetPixel(lx, ly, Color.FromArgb(brushindex));

                        using (Graphics g = Graphics.FromImage(nlbit.falseColor))
                        {
                            g.FillEllipse(curBrush, lx - (brushsize / 2), ly - (brushsize / 2), brushsize, brushsize);
                            replaceFakeBrushWithRealBrushColors();
                        }
                    }
                }


                this.canv.setCanvasImage(nlbit.getTrueColorBitmap());
                pictureBox1.Image = canv.canvImage;
            }
        }
Example #2
0
        private void x32OctreeQuantizationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult dr = importDialog.ShowDialog();

            if (dr == System.Windows.Forms.DialogResult.OK)
            {
                Image         test    = Image.FromFile(importDialog.FileName);
                NewLeafBitmap tortuga = NewLeafBitmap.NLBfromBitmap((Bitmap)test);

                nlbit = tortuga;

                this.canv.setCanvasImage(tortuga.getTrueColorBitmap());
                pictureBox1.Image = canv.canvImage;
                exposed           = Graphics.FromImage(nlbit.falseColor);
                refreshPalette();
            }
        }
Example #3
0
        private void button3_Click_1(object sender, EventArgs e)
        {
            simple = new SimplePattern();

            NewLeafBitmap nlb = new NewLeafBitmap();

            nlb.falseColor = new Bitmap(32, 32);

            nlb.filepal = new byte[15];
            //BitmapEditor ed = new BitmapEditor();
            //ed.nlbit = nlb;
            //ed.refreshPalette();
            // ed.ShowDialog();

            nombo.Text   = simple.designName;
            authbox.Text = simple.creatorName;
            citybox.Text = simple.cityName;

            button5.Enabled = true;

            pictureBox1.Image = nlb.getTrueColorBitmap();
        }