|
|
Регистрация Восстановить пароль |
Регистрация | Задать вопрос |
Заплачу за решение |
Новые сообщения |
Сообщения за день |
Расширенный поиск |
Правила |
Всё прочитано |
|
Опции темы | Поиск в этой теме |
04.04.2016, 14:11 | #1 |
Новичок
Джуниор
Регистрация: 04.04.2016
Сообщений: 4
|
Объединение объектов в форме WPF
Всем привет! Прошу помощи! Совершенно не имею опыта в WPF, на данный момент не получается объединить объекты: несколько квадратов Rectangle и кривую Безье. Мне надо, чтобы части квадратов, находящиеся выше кривой - не отображались - имели белый цвет.
Во вложении две картинки: как выглядит сейчас картинка и как должна выглядеть. Вообще мне надо реализовать это в динамическом коде, то есть файле *.cs , но пока пытаюсь хотя бы в разметке это сделать. Вот разметка: Код:
Код:
|
04.04.2016, 14:13 | #2 |
Старожил
Регистрация: 12.01.2011
Сообщений: 19,500
|
Какую именно ошибку?
Ушел с форума, https://www.programmersforum.rocks, alex.pantec@gmail.com, https://github.com/AlexP11223
ЛС отключены Аларом. |
04.04.2016, 14:22 | #3 |
Новичок
Джуниор
Регистрация: 04.04.2016
Сообщений: 4
|
Ошибка
Не удается применить объект типа "System.Windows.Shapes.Path" к свойству, для которого требуется тип "System.Windows.Media.Geometry" .
|
04.04.2016, 14:32 | #4 |
Старожил
Регистрация: 12.01.2011
Сообщений: 19,500
|
Туда наверно надо PathGeometry, а не Path.
Ушел с форума, https://www.programmersforum.rocks, alex.pantec@gmail.com, https://github.com/AlexP11223
ЛС отключены Аларом. |
04.04.2016, 14:40 | #5 |
Новичок
Джуниор
Регистрация: 04.04.2016
Сообщений: 4
|
Вообще, во втором листинге я попытался объединить только один эллипс с кривой и их я объявляю в Window.Resources
Может, не лучший способ - делать комбинирование через CombinedGeometry. Дело в том, что цвета квадратов и их координаты я не знаю заранее, и их большое множество. |
04.04.2016, 16:49 | #6 |
Старожил
Регистрация: 12.01.2011
Сообщений: 19,500
|
Так задача-то в чем? Откуда берутся квадраты и кривая?
Простой пример с одним прямоугольником как-то так: Код:
Ушел с форума, https://www.programmersforum.rocks, alex.pantec@gmail.com, https://github.com/AlexP11223
ЛС отключены Аларом. |
04.04.2016, 19:48 | #7 |
Новичок
Джуниор
Регистрация: 04.04.2016
Сообщений: 4
|
Дело в том, что не получается объединить больше, чем две фигуры, как это на рисунке: то есть несколько квадратов и кривая.
Последний раз редактировалось ViktorGugo; 04.04.2016 в 20:04. |
04.04.2016, 21:30 | #8 |
Старожил
Регистрация: 12.01.2011
Сообщений: 19,500
|
Так например:
Код:
Ушел с форума, https://www.programmersforum.rocks, alex.pantec@gmail.com, https://github.com/AlexP11223
ЛС отключены Аларом. |
Похожие темы | ||||
Тема | Автор | Раздел | Ответов | Последнее сообщение |
[WPF][C#] Одновременная анимация 100-а и больше объектов | Dj_SheLL | WPF, UWP, WinRT, XAML | 3 | 05.11.2015 10:38 |
Создание нескольких (группы) 3D объектов в wpf | p0keT | WPF, UWP, WinRT, XAML | 4 | 05.03.2015 17:37 |
Перетасовка объектов на форме | jonyroww | Помощь студентам | 0 | 28.05.2014 16:25 |
Положение объектов на форме | Port 111 | Общие вопросы Delphi | 8 | 12.01.2009 22:11 |