如何将Form上的图片拖放到photoshop中??急急急,盼望高手指点。
解决方案 »
- 求助:从TabPages动态提取DataGridView的问题
- 图形图像问题?100分求思路!
- WINFORM挂掉了。情况不明白,大家来分析分析啊。
- 两个int相除求百分比,应该转换成double还是decimal?
- 请推荐一个与WebCast的Live Meeting功能相似的网络教学软件{能在线教学,讨论的(外网)},回者有分
- 如何 使 XTraGrid 行 单元格 锁定
- 请问一下C#里面 const 和readonly 有什么区别
- 有没有办法在知道某个名字或者某个类型的情况下 实现想对应的实例化对象
- 我想自己编制语音录制,直接保存为mp3,而不是wave文件的程序,请帮助!
- 我的笔记本运行VS2017特别卡顿是什么原因?
- 居然不能贴图!JIT调试失败,出现如下错误:拒绝访问
- 如何用按键打开另一个窗体?(C#)
如何用C#编程序实现,直接拖动form上的图片到打开的photoshop中?
=======================================================
有道理.应该这样做了.复制到剪贴板上就可以了
下面的链接都是说明拖动到资源管理器的,不过对于Photoshop也是一样的。
lz可以参考,至于散尽所有点数就不必了,能帮就帮,别人不能帮就靠自己了。
呵呵,有用的话,把分数给我就行了。just a joke!http://blog.joycode.com/felix/articles/38825.aspx
http://blog.joycode.com/felix/archive/2004/11/13/38826.aspx
把原文转过来共大家参考:[转]http://blog.joycode.com/felix/articles/38825.aspx
How to implement Drag and Drop from managed WinForm to Explorer The following code will enable dragging ListView items and dropping in Explorer to generate files. Temporary files will be generated and deferred rendering will be used... using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data;using System.IO; namespace WinFormDragNDropExplorer{ /// <summary> /// Summary description for Form1. /// </summary> public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.ListView listView1; /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.Container components = null; public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // } /// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("Item 1"); System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem("Item 2"); System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem("Item 3"); this.listView1 = new System.Windows.Forms.ListView(); this.SuspendLayout(); // // listView1 // this.listView1.Items.AddRange(new System.Windows.Forms.ListViewItem[] { listViewItem1, listViewItem2, listViewItem3}); this.listView1.Location = new System.Drawing.Point(40, 24); this.listView1.Name = "listView1"; this.listView1.Size = new System.Drawing.Size(384, 280); this.listView1.TabIndex = 0; this.listView1.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.listView1_QueryContinueDrag); this.listView1.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.listView1_ItemDrag); // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(472, 333); this.Controls.Add(this.listView1); this.Name = "Form1"; this.Text = "Form1"; this.ResumeLayout(false); } #endregion /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.Run(new Form1()); } private ShellDataObject dataObj = null; private void listView1_QueryContinueDrag(object sender, System.Windows.Forms.QueryContinueDragEventArgs e) { //ESC pressed if (e.EscapePressed) { e.Action = DragAction.Cancel; return; } //Drop! if (e.KeyState == 0) { dataObj.SetData(ShellClipboardFormats.CFSTR_INDRAGLOOP, 0); e.Action = DragAction.Drop; return; } e.Action = DragAction.Continue; } private void listView1_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e) { String[] fileNames; //Create the data object used for the drag drop operation dataObj = new ShellDataObject(); //Create an array of strings to hold the filename(s) fileNames = new String[listView1.SelectedItems.Count]; //Create temporary files that the user can drag. for (int i = 0; i < listView1.SelectedItems.Count; i++) { fileNames[i] = CreateTemporaryFileName(listView1.SelectedItems[i].Text + ".txt"); } //Add the list of files to the data object dataObj.SetData(DataFormats.FileDrop, fileNames); //Set the preferred drop effect dataObj.SetData(ShellClipboardFormats.CFSTR_PREFERREDDROPEFFECT, DragDropEffects.Move); //Indicate that we are in a drag loop dataObj.SetData(ShellClipboardFormats.CFSTR_INDRAGLOOP, 1); //Initiate the drag operation listView1.DoDragDrop(dataObj, DragDropEffects.Move | DragDropEffects.Copy); //Free the data object dataObj = null; } private String CreateTemporaryFileName(String name) { String path; String fileName; System.IO.StreamWriter file; //Build a path for the temporary file path = System.IO.Path.GetTempPath(); fileName = System.IO.Path.Combine(path, name); //Create the temporary file to make sure it exists file = new System.IO.StreamWriter(fileName); file.Close(); return fileName; } }