Beispiel #1
0
        private void Close(object sender, CancelEventArgs e)
        {
            var loader = new CardLoader();
            var bitmap = MakeThumbnail(cardView.Image);

            using (var thumb = new MemoryStream())
            {
                bitmap.Save(thumb, System.Drawing.Imaging.ImageFormat.Png);
                loader.SaveToFile("last.card", Card, thumb);
            }
        }
Beispiel #2
0
        private void SaveCardToFile(object sender, RoutedEventArgs e)
        {
            using (var dialog = new CommonSaveFileDialog())
            {
                dialog.Filters.Add(new CommonFileDialogFilter("Card", "*.card"));
                dialog.DefaultExtension = "card";
                dialog.DefaultFileName  = MakeValidFileName(Card.Set + " " + Card.Name);
                dialog.OverwritePrompt  = true;

                if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
                {
                    var loader = new CardLoader();
                    var bitmap = MakeThumbnail(cardView.Image);

                    using (var thumb = new MemoryStream())
                    {
                        bitmap.Save(thumb, System.Drawing.Imaging.ImageFormat.Png);
                        loader.SaveToFile(dialog.FileName, Card, thumb);
                    }
                }
            }
        }