如果您使用的是.net,并且您的最终目标是保存文件,那么更简单的方法,
这里的代码用C sharp,将它移植到VB.nt中不会很难,我只是懒得这样做:)无论如何你必须把它保存在哪里才能粘贴它所以......
它将文件加载到图片框并再次将其保存到文件中(跛脚,我知道)并将clipbaord数据设置为复制操作
然后当你粘贴(Ctrl + V)它时,它会被粘贴.
C#
__
Bitmap bmp;
string fileName=@"C:\image.bmp";
//here I assume you load it from a file, you might get the image from somewhere else, your code may differ
pictureBox1.Image=(Image) Bitmap.FromFile(fileName);
bmp=(Bitmap)pictureBox1.Image;
bmp.Save(@"c:\image2.bmp");
System.Collections.Specialized.StringCollection st = new
System.Collections.Specialized.StringCollection();
st.Add(@"c:\image2.bmp");
System.Windows.Forms.Clipboard.SetFileDropList(st);
</pre>
Run Code Online (Sandbox Code Playgroud)
和中提琴尝试粘贴文件image2.bmp粘贴文件夹.
| 归档时间: |
|
| 查看次数: |
14830 次 |
| 最近记录: |