You could change the encoding of an image without saving it to a file, but not without saving it to a variable in your code. The Clipboard class basically just has some Get and Set methods. The only way to change what's in the clipboard is to call one of the Get methods into a local variable, change whatever it is you just got, and then call one of the Set methods, passing in your changed object. This results in a changed clipboard object, but not without the intermediate step of "saving" it to a variable.
Clipboard does not expose any methods for directly manipulating the memory of the object in the clipboard. Even if such a method were exposed, changing the encoding of an image from binary to Base64 involves fundamentally changing all of the memory, so there wouldn't be much value to it.
Update: here's a method that will take an image from the clipboard, convert it to a base64 string, and put it back into the clipboard:
if (Clipboard.ContainsImage())
{
using (MemoryStream memory = new MemoryStream())
{
using (Image img = Clipboard.GetImage())
{
img.Save(memory, img.RawFormat);
}
string base64 = Convert.ToBase64String(memory.ToArray());
Clipboard.SetText(base64);
}
}
And you'll need these two using statements:
using System.IO;
using System.Windows.Forms;
It's untested (because it's past my bedtime), but it should work. It does involve the use of local variables, but this is unavoidable (as well as normal).