Show image from clipboard to defalut imageviewer of windows using c#.net
- by Rajesh Rolen- DotNet Developer
I am using below function to make a image of current form and set it in clipboard
Image bit = new Bitmap(this.Width, this.Height);
Graphics gs = Graphics.FromImage(bit);
gs.CopyFromScreen(this.Location, new Point(0, 0), bit.Size);
Guid guid = System.Guid.NewGuid();
string FileName = guid.ToString();
//Copy that image in the clipbaord.
Image imgToCopy = Image.FromFile(Path.Combine(Environment.CurrentDirectory, FileName + ".jpg"));
Clipboard.SetImage(imgToCopy);
Now my image is in clipboard and i am able to show it in picturebox on other form using below code :
mypicturebox.Image = Clipboard.GetImage();
Now the the problem is that i want to show it in default imageviewer of that system. so for that i think using "System.Diagnostics.Process.Start" we can do that.. but i dont know, how to find default imageviewer and how to set clipboard's image in that ... please help me out... if i find solution than thats good otherwise i am thinking to save that file from clipboard to harddisk and then view it in window's default imageviewer... please help me to resolve my problem.. i am using c#.net