示例#1
0
 public Form1()
 {
     InitializeComponent();
     processingService     = new ProcessingServiceImpl();
     processButton.Enabled = false;
     //заполняем выпадающий список
     filterList.Items.AddRange(ZeroNeighborsSharedFilter.GetAllFilters().ToArray());
     filterList.SelectedIndex = 0;
 }
示例#2
0
        static void Main(string[] args)
        {
            ImagePeerService peerService = new ImagePeerService();

            while (!peerService.IsConnected)
            {
                peerService.TryToConnect(EndPoint);
                Console.WriteLine($"Appointed GUID: {peerService.Guid}");
            }

            while (true)
            {
                ImageProcessingMessage    message = peerService.WaitForMessage();
                ZeroNeighborsSharedFilter filter  = ZeroNeighborsSharedFilter.GetFilterByID(message.FilterID);
                for (int i = 0; i < message.ImageArray.Length; i++)
                {
                    message.ImageArray[i] = filter.Filter(message.ImageArray[i]);
                }
                peerService.SendMessage(message);
            }
        }