С Новым годом! Форум программистов, компьютерный форум, киберфорум
C# Windows Forms
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 5.00/11: Рейтинг темы: голосов - 11, средняя оценка - 5.00
1 / 1 / 0
Регистрация: 12.09.2015
Сообщений: 74

Графический редактор: пересечение фигур окрасить в градиент

20.11.2015, 14:17. Показов 2034. Ответов 9
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Короче нужна помощь в граф редакторе
1 форма
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
using System;
using System.Drawing.Drawing2D;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Printing;
 
namespace Paint1
{
    public partial class Paint : Form
    {
        private New form2 = new New();
        private int mode;
        private Point movePt;
        private Point nullPt = new Point(int.MaxValue, 0);
        private Pen pen = new Pen(Color.Black);
        private Pen stir = new Pen(Color.White);
        private Point StartPt;
        private SolidBrush brush = new SolidBrush(Color.White);
        private int figureMode;
        private bool equalSize;
        private Bitmap oldImage;
        private Font font;// текст
 
 
 
        public Paint()
        {
            InitializeComponent();
            AddOwnedForm(form2);
            openFileDialog1.InitialDirectory = saveFileDialog1.InitialDirectory =
                Directory.GetCurrentDirectory();
            form2.numericUpDown1.Value = panel1.ClientSize.Width;
            form2.numericUpDown2.Value = panel1.ClientSize.Height;
            form2.button1_Click(this, null);// чистое поле при запуске 
            pen.StartCap = pen.EndCap = LineCap.Round;// сглаживание
            pen.Alignment = PenAlignment.Inset;//для правильного задания размера прямоугольников
            oldImage = new Bitmap(pictureBox1.Image);
            font = Font.Clone() as Font;
            comboBox1.SelectedIndex = 0;
        }
       
        // Выбор и рисование фигур
        private void DrawFigure(Rectangle r, Graphics g)
        {
            switch (figureMode)
            {
                case 0:
                    if (!checkBox1.Checked)
                        g.FillRectangle(brush, r);
                    g.DrawRectangle(pen, r);
                    break;
                case 1:
                    if (!checkBox1.Checked)
                        g.FillEllipse(brush, r);
                    g.DrawEllipse(pen, r);
                    break;
            }
        }
        // метод рисования прямоугольника
        private Rectangle PtToRect(Point p1, Point p2)
        {
            if (equalSize)
            {
                int dx = p2.X - p1.X, dy = p2.Y - p1.Y;
                if (Math.Abs(dx) > Math.Abs(dy))
                    p2.X = p1.X + Math.Sign(dx) * Math.Abs(dy);
                else
                    p2.Y = p1.Y + Math.Sign(dy) * Math.Abs(dx);
            }
            int x = Math.Min(p1.X, p2.X),
                y = Math.Min(p1.Y, p2.Y),
                w = Math.Abs(p2.X - p1.X),
                h = Math.Abs(p2.Y - p1.Y);
            return new Rectangle(x, y, w, h);
        }
 
        private void ReversibleDraw()
        {
            Point p1 = pictureBox1.PointToScreen(StartPt),
                p2 = pictureBox1.PointToScreen(movePt);
            if (mode == 1)
                ControlPaint.DrawReversibleLine(p1, p2, Color.Black);
            else
                ControlPaint.DrawReversibleFrame(PtToRect(p1, p2), Color.Black, (FrameStyle)((figureMode + 1) % 2));
 
        }
        //создание нового поля
        private void Newbutton1_Click(object sender, EventArgs e)
        {
 
            form2.ActiveControl = form2.numericUpDown1;
            if (form2.ShowDialog() == DialogResult.OK)
            {
                saveFileDialog1.FileName = "";
                Text = "Image Editor";
                UpdateOldImage();
            }
        }
        // открытие файла
        private void Openbutton2_Click(object sender, EventArgs e)
        {
            StartPt = nullPt;
 
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                string s = openFileDialog1.FileName;
                try
                {
                    Image im = new Bitmap(s);
                    Graphics g = Graphics.FromImage(im);
                    g.Dispose();
                    if (pictureBox1.Image != null)
                        pictureBox1.Image.Dispose();
                    pictureBox1.Image = im;
                    UpdateOldImage();// отмена действия
                }
                catch
                {
                    MessageBox.Show("File" + s + " has a wrong format.", "Error");
                    return;
                }
                Text = "Image Editor-" + s;
                saveFileDialog1.FileName = Path.ChangeExtension(s, "png");
                openFileDialog1.FileName = "";
 
 
            }
 
        }
        // сохранение файла
        private void Savebutton3_Click(object sender, EventArgs e)
        {
            StartPt = nullPt;
 
            string s0 = saveFileDialog1.FileName;
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                string s = saveFileDialog1.FileName;
                if (s.ToUpper() == s0.ToUpper())
                {
                    s0 = Path.GetDirectoryName(s0) + "\\($$##$$).png";
                    pictureBox1.Image.Save(s0);
                    pictureBox1.Image.Dispose();
                    File.Delete(s);
                    File.Move(s0, s);
                    pictureBox1.Image = new Bitmap(s);
                }
                else
                    pictureBox1.Image.Save(s);
                Text = "Image Editor-" + s;
 
            }
        }
        // отслеживание координат 
        private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
        {
            label1.Text = string.Format("X,Y:{0},{1}", e.X, e.Y);
            toolStripStatusLabel2.Text = string.Format("X,Y:{0},{1}", e.X, e.Y);
            if (StartPt == nullPt)
                return;
            if (e.Button == MouseButtons.Left)
                switch (mode)
                {
                    case 0:
                        Graphics g = Graphics.FromImage(pictureBox1.Image);
                        g.DrawLine(pen, StartPt, e.Location);
                        g.Dispose();
                        StartPt = e.Location;
                        pictureBox1.Invalidate();
                        break;
                    case 1:
                    case 2:
                        ReversibleDraw();
                        movePt = e.Location;
                        equalSize = Control.ModifierKeys == Keys.Control;
                        ReversibleDraw();
                        break;
                }
 
        }
 
        private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
        {
            movePt = StartPt = e.Location;
            UpdateOldImage();// отмена действия
            if (Control.ModifierKeys == Keys.Alt)
            {
                Color c = (pictureBox1.Image as Bitmap).GetPixel(e.X, e.Y);
                if (e.Button == MouseButtons.Left)
                    Palitlabel2.BackColor = c;
                else
                    NizPalitlabel4.BackColor = c;
            }
            else
                if (mode == 3)
                {
                    Graphics g = Graphics.FromImage(pictureBox1.Image);
                    using (SolidBrush b = new SolidBrush(pen.Color))
                        g.DrawString(textBox1.Text, font, b, e.Location);
                    g.Dispose();
                    pictureBox1.Invalidate();
                }
        }
        // обработчик для очистки
        private void Clearbutton4_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Очистить рисунок?", "Очистка", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
             == DialogResult.Yes)
            {
                UpdateOldImage();// отмена действия
                using (Graphics g = Graphics.FromImage(pictureBox1.Image))
                    g.Clear(Color.White);
                изменитьЦветФонаToolStripMenuItem.BackColor = Color.White;
                pictureBox1.Invalidate();
            }
            //{
            //    e.Cancel = true;
            //}
 
 
        }
        // задавание цвета обьектам
        private void Palitlabel2_Click(object sender, EventArgs e)
        {
            Label Lb = sender as Label;
            colorDialog1.Color = Lb.BackColor;
            if (colorDialog1.ShowDialog() == DialogResult.OK)
                Lb.BackColor = colorDialog1.Color;
            изменитьЦветПалитрыToolStripMenuItem1.BackColor = Palitlabel2.BackColor;
            textBox1.ForeColor = Palitlabel2.BackColor;
 
        }
 
        private void Palitlabel2_BackColorChanged(object sender, EventArgs e)
        {
            pen.Color = Palitlabel2.BackColor;
            Figlabel5.Invalidate();
        }
 
        private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {
            pen.Width = (int)numericUpDown1.Value;
            Figlabel5.Invalidate();
        }
 
        private void PenradioButton1_CheckedChanged(object sender, EventArgs e)
        {
            RadioButton rb = sender as RadioButton;
            if (!rb.Checked)
                return;
            mode = rb.TabIndex;
 
 
        }
 
        private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
        {
            if (StartPt == nullPt)
                return;
            if (mode >= 1)
            {
 
                Graphics g = Graphics.FromImage(pictureBox1.Image);
                switch (mode)
                {
                    case 1:
                        g.DrawLine(pen, StartPt, movePt);
                        break;
                    case 2:
                        DrawFigure(PtToRect(StartPt, movePt), g);
                        break;
                }
                g.Dispose();
                pictureBox1.Invalidate();
                this.Refresh();// не дает возможности рисовать за палитрой
            }
            {
 
            }
        }
        // Нижняя палитра
        private void NizPalitlabel4_BackColorChanged(object sender, EventArgs e)
        {
            brush.Color = NizPalitlabel4.BackColor;
            Figlabel5.Invalidate();
        }
        //Обработчик для метки с фигурами
        private void Figlabel5_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            Rectangle r = Figlabel5.ClientRectangle;
            r.Width--; r.Height--;
            DrawFigure(r, g);
        }
 
        private void Figlabel5_MouseDown(object sender, MouseEventArgs e)
        {
            FigureradioButton3.Checked = true;
            figureMode = (figureMode + 1) % 2;
            Figlabel5.Invalidate();
        }
        // Прозрачность фигур
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            Figlabel5.Invalidate();
        }
 
        // отмена действия
 
        private void UpdateOldImage()
        {
            oldImage.Dispose();
            oldImage = new Bitmap(pictureBox1.Image);
        }
        // клавиша отмены
        private void Form1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
 
                pictureBox1.Image = new Bitmap(oldImage);
            }
 
        }
        private void отменитьПоследнееToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pictureBox1.Image.Dispose();
            pictureBox1.Image = new Bitmap(oldImage);
 
        }
 
        private void изменитьЦветФонаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Рисунок будет зарисован!", "Внимание", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                UpdateOldImage();
                ToolStripMenuItem T = sender as ToolStripMenuItem;
                colorDialog1.Color = T.BackColor;
                if (colorDialog1.ShowDialog() == DialogResult.OK)
                    T.BackColor = colorDialog1.Color;
                using (Graphics g = Graphics.FromImage(pictureBox1.Image))
                    g.Clear(T.BackColor);
                pictureBox1.Invalidate();
            }
        }
        private void изменитьЦветПалитрыToolStripMenuItem1_Click(object sender, EventArgs e)
        {
 
            ToolStripMenuItem P = sender as ToolStripMenuItem;
            colorDialog1.Color = P.BackColor;
            if (colorDialog1.ShowDialog() == DialogResult.OK)
                P.BackColor = colorDialog1.Color;
            Palitlabel2.BackColor = P.BackColor;
            textBox1.ForeColor = P.BackColor;
 
        }
 
 
 
        private void textBox1_Enter(object sender, EventArgs e)
        {
            FontradioButton4.Checked = true;
        }
        // задать шрифт
        private void Fontbutton5_Click(object sender, EventArgs e)
        {
            fontDialog1.Font = font;
            if (fontDialog1.ShowDialog() == DialogResult.OK)
            {
                Font f = font;
                textBox1.Font = font = fontDialog1.Font;
                f.Dispose();
            }
        }
 
        private void comboBox1_DrawItem(object sender, DrawItemEventArgs e)
        {
            e.DrawBackground();
            // - заливка фоновым цветом области
            // связанной с рисуемым элементом списка
            using (Pen p = new Pen(e.ForeColor, 2))
            {
                // рисование образцов линий в элеметах выпадающего списка
                p.DashStyle = (DashStyle)e.Index;
                int y = (e.Bounds.Top + e.Bounds.Bottom) / 2;
                e.Graphics.DrawLine(p, e.Bounds.Left, y, e.Bounds.Right, y);
            }
            e.DrawFocusRectangle();
            // дополнительное выделение текущего элемента списка
 
 
        }
 
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            pen.DashStyle = (DashStyle)comboBox1.SelectedIndex;
            Figlabel5.Invalidate();
        }
     
 
 
 
 
    
}
Вопрос в том что например я рисую красный прямоугольник а потом синий круг они пересекаются. Я хочу чтобы это пересечение фигур красилось в градиент. Тему я находил на этом форуме но там фигуры ты задаешь в коде заранее, а в проге я их рисую
Вот прога
Вложения
Тип файла: rar прога.rar (486.5 Кб, 19 просмотров)
0
Programming
Эксперт
39485 / 9562 / 3019
Регистрация: 12.04.2006
Сообщений: 41,671
Блог
20.11.2015, 14:17
Ответы с готовыми решениями:

Графический редактор - рисование линий и фигур
я сделал чтобы определялись координаты а вот чтоб рисовалась линия и треугольник не могу Public Class Form1 Private Sub...

Графический редактор (вытягивание фигур , как Microsoft Visio)
Здравствуйте. Подскажите пожалуйста реализацию вытягивания фигур вверх, вниз,, вправо и влево, как это делаетя с Microsoft Visio(очень...

Наложение фигур друг на друга (простейший графический редактор)
Всем доброго времени суток! Я создала простенький графический редактор, но у меня возникла следующая проблема: в задании сказано, что...

9
1 / 1 / 0
Регистрация: 12.09.2015
Сообщений: 74
21.11.2015, 21:19  [ТС]
Еще раз прошу

Добавлено через 1 час 45 минут
Неужели никто с графикой работать не умеет

Добавлено через 2 часа 11 минут
апинг

Добавлено через 8 часов 48 минут
апинг

Добавлено через 3 часа 53 минуты
апинг

Добавлено через 2 часа 58 минут
апинг

Добавлено через 4 часа 22 минуты
апинг

Добавлено через 3 часа 42 минуты
я верю в помощь

Добавлено через 1 час 1 минуту
может не понятно задание? вот что мне нужно плиз Пересечение фигур различных цветов

Добавлено через 16 секунд
может не понятно задание? вот что мне нужно плиз Пересечение фигур различных цветов
0
Эксперт .NETАвтор FAQ
 Аватар для Storm23
10425 / 5155 / 1825
Регистрация: 11.01.2015
Сообщений: 6,226
Записей в блоге: 34
21.11.2015, 21:33
Цитата Сообщение от jamesmcfly Посмотреть сообщение
вот что мне нужно плиз Пересечение фигур различных цветов
В той теме дано решение. И то решение полностью подходит и под ваш случай.
0
1 / 1 / 0
Регистрация: 12.09.2015
Сообщений: 74
22.11.2015, 12:22  [ТС]
я понял а куда подставлять то неужели класс надо писать

Добавлено через 12 часов 18 минут
я не понимаю куда это вставлять

Добавлено через 1 час 44 минуты
помогите я тупой
0
1 / 1 / 0
Регистрация: 12.09.2015
Сообщений: 74
04.01.2016, 14:46  [ТС]
привет всем вопрос все еще актуален
0
911 / 796 / 329
Регистрация: 08.02.2014
Сообщений: 2,391
04.01.2016, 15:30
Тебе для этого понадобится запоминать расположения каждой нарисованной тобою фигуры. Если ты хоть чуть-чуть разобрался в paint'e то есть функция там DrawFigure внутри неё можно и запоминать то что тебе надо, далее придётся проверять нет ли в списке фигуры которые по координатам пересекается с новой нарисованной, и если есть тогда делать что-то типо:
C#
1
2
3
4
5
6
7
using (var brush = new LinearGradientBrush(new PointF(100, 100), new PointF(100, 100), Color.Blue, Color.Red))//цвета и поинты на абум, для поинтов надо прощитать центральные точки, цвета зависят от фигур твоих (их лучше тоже запомнить)
            {
                var reg1 = new Region(new Rectangle(0, 0, 200, 200));//тут путь 1ой фигуры
                var reg2 = new Region(new Rectangle(100, 100, 200, 200));//путь 2 фигуры
                reg1.Intersect(reg2);
                g.FillRegion(brush, reg1);
            }
0
1 / 1 / 0
Регистрация: 12.09.2015
Сообщений: 74
06.01.2016, 09:17  [ТС]
здраствуйте еще раз я тут переделал программу вот:
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Drawing.Drawing2D;
 
 
namespace WindowsFormsApplication3
{
    
    public partial class Form1 : Form
    {
        double A, F;
        int nterms, flag=0, a=0, b=0, c=0;
 
        Color[] clr1 = new Color[100];
        Color[] clr2 = new Color[100];
        Color[] clr3 = new Color[100];
        Region[] region1 = new Region[100];
        Region[] region2 = new Region[100];
        Region[] region3 = new Region[100];
 
        private SolidBrush brush = new SolidBrush(Color.White);
        private Pen pen = new Pen (Color.Black);
        Point[] startPt1 = new Point[100];
        Point[] endPt1 = new Point[100];
        Point[] startPt2 = new Point[100];
        Point[] twoPt2 = new Point[100];
        Point[] endPt2 = new Point[100];
        Point[] startPt3 = new Point[100];
        Point[] endPt3 = new Point[100];
 
        Point startP, endP;
 
        public Form1()
        {
            InitializeComponent();
            pen.StartCap = pen.EndCap = LineCap.Round;
            A = 20;
            F = 1;
            nterms = 1;
        }
 
        private void label1_Click(object sender, EventArgs e)
        {
            Label lb = sender as Label;
            colorDialog1.Color = lb.BackColor;
            if (colorDialog1.ShowDialog()==DialogResult.OK)
            {
                lb.BackColor = colorDialog1.Color;
            }
        }
 
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            try
            {
 
 
                nterms = Convert.ToInt32(textBox1.Text);
                numericUpDown2.Text = Convert.ToString(this.textBox1.Text);
                this.pictureBox2.Invalidate();
                this.pictureBox2.Update();
            }
            catch
            {
                MessageBox.Show("Пожалуйста не оставляйте поле пустым, так как возникает ошибка приложения");
            }
        }
 
        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            try
            {
                A = Convert.ToInt32(textBox2.Text);
                numericUpDown3.Text = Convert.ToString(this.textBox2.Text);
                this.pictureBox2.Invalidate();
                this.pictureBox2.Update();
            }
            catch
            {
                MessageBox.Show("Пожалуйста не оставляйте поле пустым, так как возникает ошибка приложения");
            }
        }
 
        private void numericUpDown2_ValueChanged(object sender, EventArgs e)
        {
            nterms = Convert.ToInt32(this.numericUpDown2.Value);
            textBox1.Text=Convert.ToString(this.numericUpDown2.Value);
            this.pictureBox2.Invalidate();
            this.pictureBox2.Update();
        }
 
        private void numericUpDown3_ValueChanged(object sender, EventArgs e)
        {
            A = Convert.ToInt32(this.numericUpDown3.Value);
            textBox2.Text = Convert.ToString(this.numericUpDown3.Value);
            this.pictureBox2.Invalidate();
            this.pictureBox2.Update();
        }
 
        private void numericUpDown4_ValueChanged(object sender, EventArgs e)
        {
            F = Convert.ToInt32(this.numericUpDown4.Value);
            textBox3.Text = Convert.ToString(this.numericUpDown4.Value);
            this.pictureBox2.Invalidate();
            this.pictureBox2.Update();
        }
 
        private void textBox3_TextChanged(object sender, EventArgs e)
        {
            try
            {
                F = Convert.ToInt32(textBox3.Text);
                numericUpDown4.Text = Convert.ToString(this.textBox3.Text);
                this.pictureBox2.Invalidate();
                this.pictureBox2.Update();
            }
            catch
            {
                MessageBox.Show("Пожалуйста не оставляйте поле пустым, так как возникает ошибка приложения");
            }
        }
 
        private void button5_Click(object sender, EventArgs e)
        {
            Graphics Fure = Graphics.FromHwnd(pictureBox2.Handle);
            int i, j, angle;
            double yp, y1, y2, yk;
            pen.Color = Color.Red;
            pen.Width = 2;
 
            angle = 0;
            i = 0; j = 1;
            yp = yk = 0;
            startP.Y = this.pictureBox2.Height / 2;
            startP.X = this.pictureBox2.Left;
            while (i <= this.pictureBox2.Width)
            {
                j = 1;
                while (j <= nterms)
                {
                    y1 = A / ((2 * j) - 1);
                    y2 = Math.Sin((2 * j - 1) * F * 0.01397 * angle);
                    yp = yp + y1 * y2;
                    yk = yk - y1 * y2;
                    j++;
                }
                
                endP.X = i + 1;
                endP.Y = (int)(this.pictureBox2.Height / 2) + Convert.ToInt32(yp);
                Fure.DrawLine(pen, startP.X, startP.Y, endP.X, endP.Y);
                startP.X = endP.X;
                startP.Y = endP.Y;
                endP.X = i;
                endP.Y = (int)(this.pictureBox2.Height / 2) - Convert.ToInt32(yk);
                Fure.DrawLine(pen, startP.X, startP.Y, endP.X, endP.Y);
                startP.X = endP.X;
                startP.Y = endP.Y;
                yp = 0; yk = 0;
                angle = angle + 1;
                i++;
            }
        }
 
        private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
        {
            if (radioButton1.Checked == true) startPt1[a] = e.Location;
            else if (radioButton3.Checked == true) startPt3[c] = e.Location;
            else if (radioButton2.Checked==true) 
            {
                if (flag == 0) {startPt2[b] = e.Location; flag++;}
                else if (flag == 1) { twoPt2[b] = e.Location; flag++; }
                else if (flag == 2) { endPt2[b] = e.Location; flag++; }
            }
        }
Проблемы:
1.делает градиент через раз
2.фигуры рисуются хреново
3.с несколькими фигурами градиент не получается
может кто подскажет что делать
Честно скажу по координатам определять не получилось
Вложения
Тип файла: rar работаю.rar (72.3 Кб, 16 просмотров)
0
1 / 1 / 0
Регистрация: 12.09.2015
Сообщений: 74
06.01.2016, 09:19  [ТС]
продолжение
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
        private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
        {
            if (radioButton1.Checked == true) startPt1[a] = e.Location;
            else if (radioButton3.Checked == true) startPt3[c] = e.Location;
            else if (radioButton2.Checked==true) 
            {
                if (flag == 0) {startPt2[b] = e.Location; flag++;}
                else if (flag == 1) { twoPt2[b] = e.Location; flag++; }
                else if (flag == 2) { endPt2[b] = e.Location; flag++; }
            }
        }
 
        private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (radioButton1.Checked == true)
                {
                    GraphicsPath pp1 = new GraphicsPath();
                    Graphics g = Graphics.FromHwnd(pictureBox1.Handle);
                    clr1[a] = label1.BackColor;
                    SolidBrush brush = new SolidBrush(clr1[a]);
                    endPt1[a] = e.Location;
                    pp1.AddRectangle(new Rectangle(startPt1[a].X, startPt1[a].Y, endPt1[a].X - startPt1[a].X, endPt1[a].Y - startPt1[a].Y));
                    region1[a] = new Region(pp1);
                    g.FillRegion(brush, region1[a]);
                    g.DrawPath(Pens.Silver, pp1);
 
                    //с прямоугольником
                    if (a!=0)
                    for (int a1 = 0; a1 < a; a1++)
                    {
                        var r = region1[a1];
                        r.Intersect(region1[a]);
                        if (startPt1[a].X <= endPt1[a].X)
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(startPt1[a], endPt1[a1], clr1[a1], clr1[a]);
                            g.FillRegion(gb, r);
                        }
                        else
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(endPt1[a1], startPt1[a], clr1[a1], clr1[a]);
                            g.FillRegion(gb, r);
                        }
 
                    }
 
                    //с треугольником
                    if (b!=0) 
                    for (int b1 = 0; b1 < b; b1++)
                    {
                        var r = region2[b1];
                        r.Intersect(region1[a]);
                        if (startPt1[a].X <= endPt2[b1].X)
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(startPt1[a], endPt2[b1], clr1[a], clr2[b1]);
                            g.FillRegion(gb, r);
                        }
                        else if (startPt1[a].X <= startPt2[b1].X)
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(startPt1[a], startPt2[b1], clr1[a], clr2[b1]);
                            g.FillRegion(gb, r);
                        }
                        else if (startPt1[a].X <= twoPt2[b1].X)
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(startPt1[a], twoPt2[b1], clr1[a], clr2[b1]);
                            g.FillRegion(gb, r);
                        }
 
                    }
 
                    //с эллипсом
                    if (c!=0)
                    for (int c1 = 0; c1 < c; c1++)
                    {
                        var r = region3[c1];
                        r.Intersect(region1[a]);
                        if (startPt1[a].X <= endPt3[c1].X)
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(startPt1[a], endPt3[c1], clr1[a], clr3[c1]);
                            g.FillRegion(gb, r);
                        }
                        else
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(endPt1[c1], startPt1[a], clr1[a], clr3[c1]);
                            g.FillRegion(gb, r);
                        }
 
                    }
                        a++;
                    g.Dispose();
                }
                else if (radioButton3.Checked == true)
                {
                    GraphicsPath pp3 = new GraphicsPath();
                    Graphics g = Graphics.FromHwnd(pictureBox1.Handle);
                    clr3[c] = label1.BackColor;
                    SolidBrush brush = new SolidBrush(clr3[c]);
                    endPt3[c] = e.Location;
                    pp3.AddEllipse(startPt3[c].X, startPt3[c].Y, endPt3[c].X - startPt3[c].X, endPt3[c].Y - startPt3[c].Y);
                    region3[c] = new Region(pp3);
                    g.FillRegion(brush, region3[c]);
                    g.DrawPath(Pens.Silver, pp3);
 
                    //с прямоугольником
                    if (a!=0)
                    for (int a1 = 0; a1 < a; a1++)
                    {
                        var r = region1[a1];
                        r.Intersect(region3[c]);
                        if (startPt3[c].X <= endPt1[a1].X)
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(startPt3[c], endPt1[a1], clr3[c], clr1[a1]);
                            g.FillRegion(gb, r);
                        }
                        else
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(endPt1[a1], startPt3[c], clr3[c], clr1[a1]);
                            g.FillRegion(gb, r);
                        }
                    }
 
                    if (b!=0)
                    //с треугольником
                    for (int b1 = 0; b1 < b; b1++)
                    {
                        var r = region2[b1];
                        r.Intersect(region3[c]);
                        if (startPt3[c].X <= endPt2[b1].X)
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(startPt3[c], endPt2[b1], clr3[c], clr2[b1]);
                            g.FillRegion(gb, r);
                        }
                        else if (startPt3[c].X <= startPt2[b1].X)
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(startPt3[c], startPt2[b1], clr3[c], clr2[b1]);
                            g.FillRegion(gb, r);
                        }
                        else if (startPt3[c].X <= twoPt2[b1].X)
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(startPt3[c], twoPt2[b1], clr3[c], clr2[b1]);
                            g.FillRegion(gb, r);
                        }
                    }
                    
                    //с эллипсом
                    if (c!=0)
                    for (int c1 = 0; c1 < c; c1++)
                    {
                        var r = region3[c1];
                        r.Intersect(region3[c]);
                        if (startPt3[c].X <= endPt3[c1].X)
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(startPt3[c], endPt3[c1], clr3[c], clr3[c1]);
                            g.FillRegion(gb, r);
                        }
                        else
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(endPt3[c1], startPt3[c], clr3[c], clr3[c1]);
                            g.FillRegion(gb, r);
                        }
                    }
 
                    c++;
                    g.Dispose();
                }
                else if (radioButton2.Checked == true && flag==3)
                {
                    GraphicsPath pp2 = new GraphicsPath();
                    Graphics g = Graphics.FromHwnd(pictureBox1.Handle);
                    clr2[b] = label1.BackColor;
                    SolidBrush brush = new SolidBrush(clr2[b]);
                    Point[] PointArray = { new Point(startPt2[b].X, startPt2[b].Y), new Point(twoPt2[b].X, twoPt2[b].Y), new Point(endPt2[b].X, endPt2[b].Y) };
                    pp2.AddPolygon(PointArray);
                    region2[b] = new Region(pp2);
                    g.FillPolygon(brush, PointArray);
                    g.DrawPath(Pens.Silver, pp2);
 
                    //с прямоугольником
                    if (a!=0)
                    for (int a1 = 0; a1 < a; a1++)
                    {
                        var r = region1[a1];
                        r.Intersect(region2[b]);
                        if (startPt1[a1].X <= endPt2[b].X)
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(startPt1[a1], endPt2[b], clr1[a1], clr2[b]);
                            g.FillRegion(gb, r);
                        }
                        else if (startPt1[a1].X <= startPt2[b].X)
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(startPt1[a1], startPt2[b], clr1[a1], clr2[b]);
                            g.FillRegion(gb, r);
                        }
                        else if (startPt1[a1].X <= twoPt2[b].X)
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(startPt1[a1], twoPt2[b], clr1[a1], clr2[b]);
                            g.FillRegion(gb, r);
                        }
                    }
 
                    //с треугольником
                    if (b!=0)
                    for (int b1 = 0; b1 < b; b1++)
                    {
                        var r = region2[b1];
                        r.Intersect(region2[b]);
 
                        if (startPt2[b].X <= endPt2[b1].X && startPt2[b].X <= startPt2[b1].X && startPt2[b].X <= twoPt2[b1].X)
                        {
                            if (endPt2[b1].X <= startPt2[b1].X && twoPt2[b1].X <= startPt2[b1].X)
                            {
                                LinearGradientBrush gb = new LinearGradientBrush(startPt2[b], endPt2[b1], clr2[b], clr2[b1]);
                                g.FillRegion(gb, r);
                            }
                            else if (startPt2[b1].X <= endPt2[b1].X && startPt2[b1].X <= twoPt2[b1].X)
                            {
                                LinearGradientBrush gb = new LinearGradientBrush(startPt2[b], startPt2[b1], clr2[b], clr2[b1]);
                                g.FillRegion(gb, r);
                            }
                            else 
                            {
                                LinearGradientBrush gb = new LinearGradientBrush(startPt2[b], twoPt2[b1], clr2[b], clr2[b1]);
                                g.FillRegion(gb, r);
                            }
                        }
                        else if (endPt2[b].X <= endPt2[b1].X && startPt2[b].X <= startPt2[b1].X && startPt2[b].X <= twoPt2[b1].X)
                        {
                            if (endPt2[b1].X <= startPt2[b1].X && twoPt2[b1].X <= startPt2[b1].X)
                            {
                                LinearGradientBrush gb = new LinearGradientBrush(endPt2[b], endPt2[b1], clr2[b], clr2[b1]);
                                g.FillRegion(gb, r);
                            }
                            else if (startPt2[b1].X <= endPt2[b1].X && startPt2[b1].X <= twoPt2[b1].X)
                            {
                                LinearGradientBrush gb = new LinearGradientBrush(endPt2[b], startPt2[b1], clr2[b], clr2[b1]);
                                g.FillRegion(gb, r);
                            }
                            else
                            {
                                LinearGradientBrush gb = new LinearGradientBrush(endPt2[b], twoPt2[b1], clr2[b], clr2[b1]);
                                g.FillRegion(gb, r);
                            }
                        }
                        else if (twoPt2[b].X <= endPt2[b1].X && startPt2[b].X <= startPt2[b1].X && startPt2[b].X <= twoPt2[b1].X)
                        {
                            if (endPt2[b1].X <= startPt2[b1].X && twoPt2[b1].X <= startPt2[b1].X)
                            {
                                LinearGradientBrush gb = new LinearGradientBrush(twoPt2[b], endPt2[b1], clr2[b], clr2[b1]);
                                g.FillRegion(gb, r);
                            }
                            else if (startPt2[b1].X <= endPt2[b1].X && startPt2[b1].X <= twoPt2[b1].X)
                            {
                                LinearGradientBrush gb = new LinearGradientBrush(twoPt2[b], startPt2[b1], clr2[b], clr2[b1]);
                                g.FillRegion(gb, r);
                            }
                            else
                            {
                                LinearGradientBrush gb = new LinearGradientBrush(twoPt2[b], twoPt2[b1], clr2[b], clr2[b1]);
                                g.FillRegion(gb, r);
                            }
                        }
                    }
 
                    //с эллипсом
                    if (c!=0)
                    for (int c1 = 0; c1 < c; c1++)
                    {
                        var r = region3[c1];
                        r.Intersect(region2[b]);
                        if (startPt3[c1].X <= endPt2[b].X)
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(startPt3[c1], endPt2[b], clr3[c1], clr2[b]);
                            g.FillRegion(gb, r);
                        }
                        else if (startPt3[c1].X <= startPt2[b].X)
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(startPt3[c1], startPt2[b], clr3[c1], clr2[b]);
                            g.FillRegion(gb, r);
                        }
                        else if (startPt3[c1].X <= twoPt2[b].X)
                        {
                            LinearGradientBrush gb = new LinearGradientBrush(startPt3[c1], twoPt2[b], clr3[c1], clr2[b]);
                            g.FillRegion(gb, r);
                        }
                    }
 
                    b++;
 
                    g.Dispose();
                    flag = 0;
                }
            }
        }
 
        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            flag=0;
        }
    }
}
0
Эксперт .NETАвтор FAQ
 Аватар для Storm23
10425 / 5155 / 1825
Регистрация: 11.01.2015
Сообщений: 6,226
Записей в блоге: 34
06.01.2016, 11:13
Цитата Сообщение от jamesmcfly Посмотреть сообщение
пересечение фигур красилось в градиент
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
 
namespace WindowsFormsApplication327
{
    public partial class Form1 : Form
    {
        private List<Figure> figures = new List<Figure>();
 
        private List<Point> currentPoints = new List<Point>();
        private ComboBox cbFigureType;
        private Label lbColor;
 
        public Form1()
        {
            InitializeComponent();
 
            cbFigureType = new ComboBox {Parent = this, DropDownStyle = ComboBoxStyle.DropDownList};
            foreach(var t in Enum.GetValues(typeof(FigureType)))
                cbFigureType.Items.Add(t);
 
            cbFigureType.SelectedIndexChanged += delegate { currentPoints.Clear(); };
            cbFigureType.SelectedIndex = 0;
 
            lbColor = new Label { Parent = this, Left = 150, BackColor = Color.Red, AutoSize = false };
            lbColor.Click += delegate
                            {
                                var dlg = new ColorDialog { Color = lbColor.BackColor };
                                if (dlg.ShowDialog() == DialogResult.OK)
                                    lbColor.BackColor = dlg.Color;
                            };
        }
 
        protected override void OnMouseClick(MouseEventArgs e)
        {
            base.OnMouseClick(e);
 
            currentPoints.Add(e.Location);
            var fig = Figure.CreateFigureIfPossible(currentPoints, (FigureType) cbFigureType.SelectedItem);
            if (fig != null)
            {
                fig.FillColor = lbColor.BackColor;
                figures.Add(fig);
                currentPoints.Clear();
                Invalidate();
            }
        }
 
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
 
            //перебираем фигуры
            foreach(var fig in figures)
            {
                var interRegion = new Region();
                interRegion.MakeEmpty();
                //ищем регион пересечения с другими фигурами
                foreach(var other in figures)
                {
                    if (other == fig) break;//ищем пересечение только с фигурами, лежащими ниже нас
                    var r = fig.Region;
                    r.Intersect(other.Region);
                    interRegion.Union(r);
                }
 
                //рисуем непересекающуюся часть
                var reg = fig.Region;
                reg.Exclude(interRegion);
                using(var brush = new SolidBrush(fig.FillColor))
                    e.Graphics.FillRegion(brush, reg);
                
                //рисуем пересекающуюся часть
                var rect = fig.Path.GetBounds();//вмещающий прямоугольник
                var boundsPath = new GraphicsPath();
                var d = (float)Math.Sqrt(rect.Width*rect.Width + rect.Height*rect.Height);//диагональ
                boundsPath.AddEllipse(new RectangleF(rect.Left + rect.Width / 2 - d/2, rect.Top + rect.Height / 2 - d/2, d, d));//описанная окружность
                using (var brush = new PathGradientBrush(boundsPath))//радиальный градиент
                {
                    brush.CenterPoint = new PointF(rect.Left + rect.Width/2f, rect.Top + rect.Height/2f);
                    brush.CenterColor = fig.FillColor;
                    brush.SurroundColors = new[] { Color.Transparent};
                    brush.FocusScales = new PointF(0, 0);
                    //рисуем
                    e.Graphics.FillRegion(brush, interRegion);
                }
            }
        }
    }
 
    public class Figure
    {
        public GraphicsPath Path = new GraphicsPath();
        public Color FillColor = Color.Red;
        public Region Region { get { return new Region(Path); } }
 
        public static Figure CreateFigureIfPossible(List<Point> points, FigureType type)
        {
            Figure res = new Figure();
 
            switch(type)
            {
                case FigureType.Rectangle: 
                    if(points.Count >= 2) res.Path.AddRectangle(Rectangle.FromLTRB(points[0].X, points[0].Y, points[1].X, points[1].Y));
                    break;
 
                case FigureType.Circle:
                    if (points.Count >= 2) res.Path.AddEllipse(Rectangle.FromLTRB(points[0].X, points[0].Y, points[1].X, points[1].Y));
                    break;
 
                case FigureType.Triangle:
                    if (points.Count >= 3) res.Path.AddLines(points.ToArray());
                    break;
            }
 
            return res.Path.PointCount > 0 ? res : null;
        }
    }
 
    public enum FigureType
    {
        Rectangle, Circle, Triangle
    }
}
1
1 / 1 / 0
Регистрация: 12.09.2015
Сообщений: 74
07.01.2016, 10:09  [ТС]
спасибо

Добавлено через 30 минут
а как фигуры рисуются я вытягиваю,а он еле еле рисует
беру прямоугольник от одного угла в другой и он нерисуется
может как-то по особенному
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
inter-admin
Эксперт
29715 / 6470 / 2152
Регистрация: 06.03.2009
Сообщений: 28,500
Блог
07.01.2016, 10:09
Помогаю со студенческими работами здесь

Графический редактор для рисования сложный геометрических фигур
Всем привет! Народ кто-нибудь может кинуть ссылку на графический редактор для рисования сложный геометрических фигур, их взаимодействия и...

Градиент цветов на пересечение объектов
Подскажите, как или с помощью чего можно закрасить пересечение фигур градиентом цветов этих фигур?

Калькулятор, редактор списка строк, графический редактор
Калькулятор:

Калькулятор, редактор списка строк, графический редактор
Помогите, кто чем может! Очень надо,хотя бы что то из этого сделать!

Пересечение фигур
Даны две фигуры: Окружность с центром в точке (x0,y0) и радиусом r, и пятиугольник заданный координатами вершин. Как можно определить факт...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
10
Ответ Создать тему
Новые блоги и статьи
Советы по крайней бережливости. Внимание, это ОЧЕНЬ длинный пост.
Programma_Boinc 28.12.2025
Советы по крайней бережливости. Внимание, это ОЧЕНЬ длинный пост. Налог на собак: https:/ / **********/ gallery/ V06K53e Финансовый отчет в Excel: https:/ / **********/ gallery/ bKBkQFf Пост отсюда. . .
Кто-нибудь знает, где можно бесплатно получить настольный компьютер или ноутбук? США.
Programma_Boinc 26.12.2025
Нашел на реддите интересную статью под названием Anyone know where to get a free Desktop or Laptop? Ниже её машинный перевод. После долгих разбирательств я наконец-то вернула себе. . .
Thinkpad X220 Tablet — это лучший бюджетный ноутбук для учёбы, точка.
Programma_Boinc 23.12.2025
Рецензия / Мнение/ Перевод Нашел на реддите интересную статью под названием The Thinkpad X220 Tablet is the best budget school laptop period . Ниже её машинный перевод. Thinkpad X220 Tablet —. . .
PhpStorm 2025.3: WSL Terminal всегда стартует в ~
and_y87 14.12.2025
PhpStorm 2025. 3: WSL Terminal всегда стартует в ~ (home), игнорируя директорию проекта Симптом: После обновления до PhpStorm 2025. 3 встроенный терминал WSL открывается в домашней директории. . .
Как объединить две одинаковые БД Access с разными данными
VikBal 11.12.2025
Помогите пожалуйста !! Как объединить 2 одинаковые БД Access с разными данными.
Новый ноутбук
volvo 07.12.2025
Всем привет. По скидке в "черную пятницу" взял себе новый ноутбук Lenovo ThinkBook 16 G7 на Амазоне: Ryzen 5 7533HS 64 Gb DDR5 1Tb NVMe 16" Full HD Display Win11 Pro
Музыка, написанная Искусственным Интеллектом
volvo 04.12.2025
Всем привет. Некоторое время назад меня заинтересовало, что уже умеет ИИ в плане написания музыки для песен, и, собственно, исполнения этих самых песен. Стихов у нас много, уже вышли 4 книги, еще 3. . .
От async/await к виртуальным потокам в Python
IndentationError 23.11.2025
Армин Ронахер поставил под сомнение async/ await. Создатель Flask заявляет: цветные функции - провал, виртуальные потоки - решение. Не threading-динозавры, а новое поколение лёгких потоков. Откат?. . .
Поиск "дружественных имён" СОМ портов
Argus19 22.11.2025
Поиск "дружественных имён" СОМ портов На странице: https:/ / norseev. ru/ 2018/ 01/ 04/ comportlist_windows/ нашёл схожую тему. Там приведён код на С++, который показывает только имена СОМ портов, типа,. . .
Сколько Государство потратило денег на меня, обеспечивая инсулином.
Programma_Boinc 20.11.2025
Сколько Государство потратило денег на меня, обеспечивая инсулином. Вот решила сделать интересный приблизительный подсчет, сколько государство потратило на меня денег на покупку инсулинов. . . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru