Ejemplo n.º 1
0
        private void Completed(object sender, AsyncCompletedEventArgs e)
        {
            if (e.Cancelled == true)
            {
            }
            else
            {
                if (isCredit.Checked == true)
                {
                    string   new_destination = filePath + "/desktoper/" + textBox2.Text + "_credit" + ".jpg";;
                    Bitmap   bit             = (Bitmap)Image.FromFile(destination);
                    Graphics g = Graphics.FromImage(bit);


                    g.DrawString(txtOwnerName.Text, new Font("Segoe UI light", 20), Brushes.White, new PointF(0, 0));
                    bit.Save(new_destination);
                    Wallpaper.SetDesktopWallpaper(new_destination, SelectedWallpaperStyle);
                }
                else
                {
                    Wallpaper.SetDesktopWallpaper(destination, WallpaperStyle.Fill);
                }

                MetroMessageBox.Show(this, textBox2.Text + " has been set as your wallpaper !", "Congratulation ! ", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
        }