private void Button_Click(object sender, RoutedEventArgs e) { Screenshot.Children.Remove(textBlock1); Screenshot.Children.Remove(textBlock2); textBlock1.Text = textBox1.Text; textBlock2.Text = textBox2.Text; Screenshot.Children.Remove(textBox1); Screenshot.Children.Remove(textBox2); Screenshot.Children.Remove(memeImage); textBlock1.Margin = new Thickness(0, 0, 0, 350); textBlock2.Margin = new Thickness(0, 350, 0, 0); //textBlock1.Height = 78; //textBlock2.Height = 78; textBlock1.VerticalAlignment = VerticalAlignment.Top; textBlock2.VerticalAlignment = VerticalAlignment.Bottom; textBlock1.HorizontalAlignment = HorizontalAlignment.Center; textBlock2.HorizontalAlignment = HorizontalAlignment.Center; textBlock1.TextAlignment = TextAlignment.Center; textBlock2.TextAlignment = TextAlignment.Center; textBlock1.Width = Screenshot.ActualWidth; textBlock2.Width = Screenshot.ActualWidth; textBlock1.FontSize = 40; textBlock2.FontSize = 40; textBlock1.FontFamily = new FontFamily("Arial"); textBlock2.FontFamily = new FontFamily("Arial"); textBlock1.FontWeight = FontWeights.ExtraBold; textBlock2.FontWeight = FontWeights.ExtraBold; Screenshot.Children.Add(memeImage); Screenshot.Children.Add(textBlock1); Screenshot.Children.Add(textBlock2); /*****************************************************************************************************/ WriteableBitmap wb = null; while ((wb = new WriteableBitmap(Screenshot, null)) == null) ; wb.Invalidate(); wb.SaveToMediaLibrary("meme" + memeSelected, false); MessageBox.Show("Your meme is saved."); }
private void OnSaveClick(object sender, RoutedEventArgs e) { if (media.Constructor == Constructor.messageMediaPhoto) { WriteableBitmap wbm = new WriteableBitmap(_bitmap); Photo photo = ((MessageMediaPhotoConstructor)media).photo; if (photo.Constructor != Constructor.photo) return; PhotoConstructor photoCons = (PhotoConstructor) photo; wbm.SaveToMediaLibrary(photoCons.caption == "" ? Helpers.GenerateRandomUlong().ToString("X") : photoCons.caption); } }
//User can save doodle if full version private void appbar_save_Click(object sender, EventArgs e) { if (licenseInfo.IsTrial()) { MessageBox.Show("Saving is unavailable in Trial Mode."); } else { WriteableBitmap bitmap = new WriteableBitmap(LayoutRoot, null); var name = String.Format("DoodlePad_{0:yyyy-MM-dd_hh-mm-ss-tt}.jpg", DateTime.Now); try { bitmap.SaveToMediaLibrary(name); MessageBox.Show("Doodle successfully saved as '" + name + "'!"); } catch (Exception ex) { MessageBox.Show("Sorry, unable to save your Doodle at this time. Make sure the phone is disconnected from your PC."); } } }