private void RightPictureBox_Click(object sender, EventArgs e) { if (curr_mode == Mode.circle) { if (custom_filter) { printing_areas.FilterCircle(RightPictureBox.PointToClient(Cursor.Position), radius, GetCustomFilter()); } else { printing_areas.FilterCircle(RightPictureBox.PointToClient(Cursor.Position), radius, current_filter); } } else if (curr_mode == Mode.poly && !poly_is_closed) { if (current_poly.Count > 0 && FillPolyHelper.CalculateDistance(current_poly[0], RightPictureBox.PointToClient(Cursor.Position)) < 5) { poly_is_closed = true; } else { current_poly.Add(RightPictureBox.PointToClient(Cursor.Position)); } printing_areas.DrawPoly(current_poly, poly_is_closed); } }
public void FilterPoly(List <Point> poly, double [,] filter) { RefreshRightFromDuplicate(); double filter_sum = SumFilter(filter); FillPolyHelper.FillPolygon(ApplyFilterOnPixel, poly, filter, filter_sum); RefreshDuplicate(); CreateHistograms(); DrawPoly(poly, true); right_picture.Refresh(); }