clipboard

Paste from clipboard

六月ゝ 毕业季﹏ 提交于 2019-12-07 06:10:36
问题 How can I paste from clipboard using jQuery ? 回答1: I don't think you can do this using javascript. Since clipboard data is part of the operating system your javascript code ill not be able to access that. 回答2: It may be possible in some browsers/environments using document.execCommand , but shouldn't be relied on and you're better off finding another solution. For posterity: document.execCommand('paste', false, null); 回答3: There is a very good JS / Flash library for this: Zero Clipboard Its

Android - Copy image to clipboard, anyone got this working?

馋奶兔 提交于 2019-12-07 06:02:26
I am trying to copy a image file from my apk to the clipboard. Here is how I am approaching it (roughly, i'm using a content provider locally which is out of the scope of the question. ClipboardManager mClipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); ContentValues values = new ContentValues(2); values.put(MediaStore.Images.Media.MIME_TYPE, "Image/jpg"); values.put(MediaStore.Images.Media.DATA, filename.getAbsolutePath()); ContentResolver theContent = getContentResolver(); Uri imageUri = theContent.insert(MediaStore.Images.Media.INTERNAL_CONTENT_URI, values);

Copy email to the clipboard with Outlook VBA

柔情痞子 提交于 2019-12-07 04:37:57
问题 How do I copy an email to the clipboard and then paste it into excel with the tables intact? I am using Outlook 2007 and I want to do the equivalent of "Click on email > Select All > Copy > Switch to Excel > Select Cell > Paste". I have the Excel Object Model pretty well figured out, but have no experience in Outlook other than the following code. Dim mapi As NameSpace Dim msg As Outlook.MailItem Set mapi = Outlook.Application.GetNamespace("MAPI") Set msg = mapi.Folders.Item(1).Folders.Item(

Clear Clipboard on SGS2 (api 10)

浪尽此生 提交于 2019-12-07 03:54:19
问题 I'm using a Samsung Galaxy S2 and tried the following: import android.text.ClipboardManager; ClipboardManager clipboard = (ClipboardManager)context.getSystemService(Context.CLIPBOARD_SERVICE); clipboard.setText(null); and clipboard.setText(""); It didn't work. Ideas? 回答1: Their is a bug with the Samsung Galaxy. It doesn't accept setting the clipboard to a blank value. You could try setting it to a space instead. clipboard.setText(" "); For further information check this 回答2: Have you tried

Copy to clipboard with no Flash - Firefox, Chrome, Safari, Opera [duplicate]

故事扮演 提交于 2019-12-07 03:54:11
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Copy to clipboard without Flash I want to copy some text from an element by a given id to clipboard. I want to be flashless solution, no Flash at all. It can be in jQuery or JavaScript. The solution for IE is simple (clipboardData), but for FF, Chrome and others - it doesn't work. Help. 回答1: There is no javascript method to do this - its prevented by browser security ... Flash is the best alternative ...

Copy text from WPF DataGrid to Clipboard to Excel

末鹿安然 提交于 2019-12-07 03:34:05
问题 I have WPF DataGrid (VS2010 C#). I copied the data from DataGrid to Clipboard and write it to an Excel file. Below is my code. dataGrid1.SelectAllCells(); dataGrid1.ClipboardCopyMode = DataGridClipboardCopyMode.IncludeHeader; ApplicationCommands.Copy.Execute(null, dataGrid1); dataGrid1.UnselectAllCells(); string path1 = "C:\\test.xls"; string result1 = (string)Clipboard.GetData(DataFormats.CommaSeparatedValue); Clipboard.Clear(); System.IO.StreamWriter file1 = new System.IO.StreamWriter(path1

Need Help Setting an Image with Transparent Background to Clipboard

江枫思渺然 提交于 2019-12-07 02:43:00
问题 I need help setting a transparent image to the clipboard. I keep getting "handle is invalid". Basically, I need a "second set of eyes" to look over the following code. (The complete working project at ftp://missico.net/ImageVisualizer.zip.) This is an image Debug Visualizer class library, but I made the included project to run as an executable for testing. (Note that window is a toolbox window and show in taskbar is set to false.) I was tired of having to perform a screen capture on the

How to add clipboard support to Matplotlib figures?

谁都会走 提交于 2019-12-07 01:35:57
问题 In MATLAB, there is a very convenient option to copy the current figure to the clipboard. Although Python/numpy/scipy/matplotlib is a great alternative to MATLAB, such an option is unfortunately missing. Can this option easily be added to Matplotlib figures? Preferably, all MPL figures should automatically benefit from this functionality. I'm using MPL's Qt4Agg backend, with PySide. 回答1: Yes, it can. The idea is to replace the default plt.figure with a custom one (a technique known as monkey

Excel to clipboard with macro decimal separator

邮差的信 提交于 2019-12-06 23:55:38
问题 I would like to copy the contents of an excel file to the clipboard, using the same separators and format regardless of user configuration. Here's my macro: Private Sub CommandButton1_Click() 'save number separators Dim d, t, u d = Application.DecimalSeparator t = Application.ThousandsSeparator u = Application.UseSystemSeparators 'set number separators With Application .DecimalSeparator = "." .ThousandsSeparator = "," .UseSystemSeparators = True End With 'create temporary copy ActiveSheet

Copy DataGridView contents to clipboard

允我心安 提交于 2019-12-06 18:36:44
问题 I want to copy the contents of a DataGridView and paste it in Excel. I tried: myDataGrid.SelectAll(); DataObject dataObj = myDataGrid.GetClipboardContent(); Clipboard.SetDataObject(dataObj, true) But this just pastes nothing. Any suggestions? 回答1: Have you added this line? myDataGrid.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText; Take a look at this MSDN article for a working sample. 回答2: If you use Microsoft Visual Studio You can do it in Design File. Your