public Form000() { InitializeComponent(); PixelFormat fmt = PixelFormat.Format8bppIndexed; Bmp000 = new Bitmap(INI_W, INI_H, fmt); int w = Bmp000.Width; int h = Bmp000.Height; int numpix = w * h; Data000 = new byte[numpix]; //for ( int j = 0; j < h; j++ ) //{ // for ( int i = 0; i < w; i++ ) // { // Data000[ i + w * j ] = (byte)( i + j ); // } //} GazoYaroImageProcessing gyip = new GazoYaroImageProcessing(); gyip.Fill(Data000, w, h, 0x00); GazoYaroUtil gyu = new GazoYaroUtil(); gyu.SetPaletteBpp08ToBmp(Bmp000); gyu.SetDataToBmp(Bmp000, Data000, w, h); }
private void pictureBox000_MouseDown(object sender, MouseEventArgs e) { if ((e.Button & MouseButtons.Left) == MouseButtons.Left) { MouseX = e.X; MouseY = e.Y; int x = MouseX; int y = MouseY; int wh = 16; GazoYaroImageProcessing gyip = new GazoYaroImageProcessing(); int w = Bmp000.Width; int h = Bmp000.Height; int xs = x - (wh >> 1); int ys = y - (wh >> 1); int xe = xs + wh - 1; int ye = ys + wh - 1; byte level = 0xff; gyip.DrawRect(Data000, w, h, xs, ys, xe, ye, level); GazoYaroUtil gyu = new GazoYaroUtil(); gyu.SetDataToBmp(Bmp000, Data000, w, h); } else if ((e.Button & MouseButtons.Right) == MouseButtons.Right) { int w = Bmp000.Width; int h = Bmp000.Height; GazoYaroImageProcessing gyip = new GazoYaroImageProcessing(); gyip.Fill(Data000, w, h, 0x00); GazoYaroUtil gyu = new GazoYaroUtil(); gyu.SetDataToBmp(Bmp000, Data000, w, h); } else { // NOP. } }