public EditTrameAscii(Main m, ImageSource s, ImageCpc i, Param p) { InitializeComponent(); main = m; main.ChangeLanguage(Controls, "EditTrameAscii"); imgSrc = s; imgCpc = i; bmpCpc = i.bitmapCpc; param = p; bmpTrame = new DirectBitmap(pictEditMatrice.Width, pictEditMatrice.Height); pictEditMatrice.Image = bmpTrame.Bitmap; DrawMatrice(); DrawTrame(); lblPen0.BackColor = Color.FromArgb(bmpCpc.GetColorPal(0).GetColorArgb); lblPen1.BackColor = Color.FromArgb(bmpCpc.GetColorPal(1).GetColorArgb); lblPen2.BackColor = Color.FromArgb(bmpCpc.GetColorPal(2).GetColorArgb); lblPen3.BackColor = Color.FromArgb(bmpCpc.GetColorPal(3).GetColorArgb); DrawPens(); }
private void DrawMatrice() { DirectBitmap bmp = new DirectBitmap(pictAllMatrice.Width, pictAllMatrice.Height); pictAllMatrice.Image = bmp.Bitmap; for (int i = 0; i < 16; i++) { for (int y = 0; y < 4; y++) { for (int x = 0; x < 4; x++) { for (int zx = 0; zx < (x == 3 ? 7 : 8); zx++) { for (int zy = 0; zy < 8; zy++) { RvbColor c = bmpCpc.GetColorPal(BitmapCpc.trameM1[i, x, y]); bmp.SetPixel(zx + ((x + (i << 2)) << 3), zy + (y << 3), c); } } } } } pictAllMatrice.Refresh(); }