简体   繁体   中英

Save image on Clipboard, and can paste to textview on other application

When i use code as below, i can save image to Clipboard.

string file = @"C:\Temp\aaa.jpg";
Clipboard.SetImage(Image.FromFile(file));

But when i try to Paste(ctrl+v) to another application, such as textbox on IBM SameTime, then will fail, and i try to paste on excel/word work area, it can paste successfully.

The weird thing is, when i use Windows Paint draw someting and right click Copy, it can paste to all application successfully.

I would like to know that is textbox not support Bitmap format?

Please advince, thanks.

You're putting a jpeg stream into a bmp wrapper object. Your application is probably not supporting this while office make this work. Try to convert first your image into bmp format which is apparently supported in your textbox.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM