Пример #1
0
        public void AddImage(string fullPath)
        {
            var canvas = new Canvas();

            canvas.Width  = 250;
            canvas.Height = 150;

            var brush = new ImageBrush();

            brush.ImageSource = new BitmapImage(new Uri(fullPath));
            canvas.Background = brush;

            canvas.Name = "img_" + Images.Count;

            LayoutPanel.Children.Add(canvas);
            _images.Add(canvas);

            ChildElementAdded?.Invoke(canvas, new EventArgs());
        }
Пример #2
0
        /// <summary>
        /// Adds new pose to the template.
        /// </summary>
        public void AddPhotoPose()
        {
            try
            {
                var canvas = new Canvas();

                canvas.Width  = 250;
                canvas.Height = 150;

                canvas.Background = new SolidColorBrush(Colors.Aqua);
                canvas.Name       = "pose_" + Poses.Count;

                LayoutPanel.Children.Add(canvas);

                _poses.Add(canvas);
                ChildElementAdded?.Invoke(canvas, new EventArgs());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }