private void painel1_MouseMove(object sender, MouseEventArgs e) { if (!Image) { Point oMouse = new Point(e.X, e.Y); Point[] pForma = null; Imagem1.Refresh(); Imagem2.Refresh(); //MUDA PONTO PARA FORMATO CARTESIANO txtX.Text = (Convert.ToDouble(Calculo.Conv(oMouse).X) / E).ToString(); txtY.Text = (Convert.ToDouble(Calculo.Conv(oMouse).Y) / E).ToString(); txtX2.Text = (Convert.ToDouble(Calculo.Conv(oMouse).X) / E).ToString(); txtY2.Text = (Convert.ToDouble(Calculo.Conv(oMouse).Y) / E).ToString(); MovLinha(Vermelho, oPainel1, oMouse); MovLinha(Vermelho, oPainel2, AjustaEscala(Calculo.AplicaCalc(oMouse, lstCALC), new Bitmap(1, 1))); pForma = oFormas.DesenharFormas(cboFORMAS.SelectedIndex, oMouse); DesenhaFormas(pForma); } }
private void ComplexPlan_Load(object sender, EventArgs e) { // CRIA ITENS DO MENU DE CONTEXTO ContextMenu.Items.Add("Save", null, salvar); // DEFINE LISTA PARA CLASSE DE FORMAS oFormas.oListaCalc = lstCALC; // TAMANHO DA LINHA sbarLINHA.Value = Convert.ToInt32(Caneta.Width); txtLINHA.Text = Convert.ToInt32(Caneta.Width).ToString(); Limpar(); //CONFIGURA IMAGENS Imagem1.Left = X; Imagem1.Top = Y; Imagem1.Width = M; Imagem1.Height = M; Imagem2.Left = X + Q2; Imagem2.Top = Y + 1; Imagem2.Width = M; Imagem2.Height = M; Tela = this.CreateGraphics(); oPainel1 = Imagem1.CreateGraphics(); oPainel2 = Imagem2.CreateGraphics(); // LISTA DE CALCULOS string[] ListaCalc = Calculo.GetCalcs(); for (int i = 0; i < ListaCalc.Length; i++) { cboREGRAS.Items.Add(ListaCalc[i].TrimEnd()); } cboREGRAS.SelectedIndex = 0; cboREGRAS.Refresh(); // LISTA DE FORMAS string[] ListaFormas = Formas.GetFormas(); for (int i = 0; i < ListaFormas.Length; i++) { if (!String.IsNullOrEmpty(ListaFormas[i])) { cboFORMAS.Items.Add(ListaFormas[i].TrimEnd()); } } cboFORMAS.SelectedIndex = 0; cboFORMAS.Refresh(); }
public void PointsImg(bool AplicarCalc) { Bitmap DesenhoCalc2 = DesenhoFundo; SpecialPoint[] Spoint = new SpecialPoint[999999]; Point Pixel = new Point(); int count = 0; int i = 1; int i2 = 1; for (i = 1; i < DesenhoFundo.Width; i++) { for (i2 = 1; i2 < DesenhoFundo.Height; i2++) { Pixel = new Point(i, i2); Pixel = AjustaEscala(Pixel, DesenhoCalc); if (AplicarCalc) { Pixel = Calculo.AplicaCalc(Pixel, lstCALC); } Spoint[count] = new SpecialPoint(Pixel.X, Pixel.Y, DesenhoFundo.GetPixel(i, i2)); count++; } } // REDESENHA OS PIXELS EM UMA NOVA IMAGEM EM BRANCO Pixels CalcPixels = new Pixels(new Bitmap(M, M), Spoint, count); DesenhoCalc = CalcPixels.ModifyPixels(); Imagem2.Image = DesenhoCalc; Imagem2.Refresh(); }