private void DrawPixelGril(Bitmap bm, Pen pen) { Graphics g = Graphics.FromImage(bm); int i = 0, width = Variables.Globals.sizeOfNewCoor_2D.Width, height = Variables.Globals.sizeOfNewCoor_2D.Height; if (chkLuoiPixel.Checked) { // Vẽ toàn bộ đường dọc for (; i <= width; i++) { if (i == width / 2) { continue; } g.DrawLine(new Pen(Color.Black), 5 * i, 0, 5 * i, picb_2DArea.Height); } // Vẽ toàn bộ đường ngang for (i = 0; i <= height; i++) { if (i == height / 2) { continue; } g.DrawLine(new Pen(Color.Black), 0, 5 * i, picb_2DArea.Width, 5 * i); } } // Vẽ 2 đường biên Ox và Oy g.DrawLine(pen, 5 * width / 2, 0, 5 * width / 2, picb_2DArea.Height); g.DrawLine(pen, 0, 5 * height / 2, picb_2DArea.Width, 5 * height / 2); g.DrawString("Y", new Font("Time New Roman", 10), Brushes.Yellow, ToaDo.NguoiDungMayTinh(new Point(1, 59))); g.DrawString("X", new Font("Time New Roman", 10), Brushes.Yellow, ToaDo.NguoiDungMayTinh(new Point(107, -1))); }
private void CircleProperties_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (ht != null) { CircleProperties cp = (sender as CircleProperties); if (e.PropertyName.Equals("radius")) { ht.Radius = cp.Radius; } else if (e.PropertyName.Equals("coorOriginal")) { ht.Point = ToaDo.NguoiDungMayTinh(cp.CoorOriginal); } } }