public ImageCpc(ConvertDelegate fctConvert) { InitializeComponent(); int tx = pictureBox.Width; int ty = pictureBox.Height; bmp = new Bitmap(tx, ty); pictureBox.Image = bmp; bmpLock = new LockBitmap(bmp); bitmapCpc = new BitmapCpc(640, 400, 1); // ### for (int i = 0; i < 16; i++) { // Générer les contrôles de "couleurs" colors[i] = new Label(); colors[i].BorderStyle = BorderStyle.FixedSingle; colors[i].Location = new Point(4 + i * 48, 568); colors[i].Size = new Size(40, 32); colors[i].Tag = i; colors[i].Click += ClickColor; Controls.Add(colors[i]); // Générer les contrôles de "bloquage couleur" lockColors[i] = new CheckBox(); lockColors[i].Location = new Point(16 + i * 48, 600); lockColors[i].Size = new Size(20, 20); lockColors[i].Tag = i; lockColors[i].Click += ClickLock; Controls.Add(lockColors[i]); lockColors[i].Update(); } Reset(); ChangeZoom(1); Convert = fctConvert; }
public void MajProjet(Projet prj, bool newCpc) { int tx = pictureBox.Width = prj.Cx * 8; int ty = pictureBox.Height = prj.Cy * 16; if (newCpc) { bitmapCpc = new BitmapCpc(tx, ty, prj.Mode); } bmp = new Bitmap(tx, ty); pictureBox.Image = bmp; bmpLock = new LockBitmap(bmp); vScrollBar.Height = ty; vScrollBar.Left = tx + 3; hScrollBar.Width = tx; hScrollBar.Top = ty + 3; if (autoRecalc.Checked) { bpRecalc_Click(this, null); } else { Render(); } }
public EditZones(Projet prj) { InitializeComponent(); int tx = pictureBox.Width = prj.Cx * 8; int ty = pictureBox.Height = prj.Cy * 16; bitmapCPC = new BitmapCpc(tx, ty, prj.Mode); pictureBox.Image = new Bitmap(tx, ty); bmpLock = new LockBitmap(pictureBox.Image as Bitmap); penWhite.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDotDot; typeZone.DataSource = System.Enum.GetValues(typeof(Zone.TypeZone)); }