Ejemplo n.º 1
0
        private void btnPreview_Click(object sender, RoutedEventArgs e)
        {
            var previewWindow = new Window();

            previewWindow.Padding = new Thickness(30);

            var image = new Image();

            image.Source  = template.RenderToBitmap();
            image.Stretch = System.Windows.Media.Stretch.Uniform;

            image.Width  = previewWindow.Width;
            image.Height = previewWindow.Height;

            previewWindow.Content = image;

            previewWindow.Show();
        }
Ejemplo n.º 2
0
        public SharePhotos(SessionTemplateCollection sessionPhotos)
        {
            InitializeComponent();
            _sessionPhotos = sessionPhotos;

            _template = Settings.CurrentTemplate;

            _templatePreview = new TemplatePreview(_template, sessionPhotos);
            frPreview.Navigate(_templatePreview);

            var brush = new ImageBrush();
            var sMgr  = new SessionManager();

            gifStream         = sMgr.GenerateGifStream(sessionPhotos);
            brush.ImageSource = sMgr.ImageFromStream(gifStream);

            btnPreviewGif.Background = brush;

            var templateBrush = new ImageBrush();

            templateBrush.ImageSource = _template.RenderToBitmap();

            btnPreviewTemplate.Background = templateBrush;
        }