clipboard

Copy multiple HTML5 layered canvases to one image in JavaScript

十年热恋 提交于 2021-01-29 07:40:30
问题 I have multiple HTML5 canvases which are placed on top of one another. The order is important. Canvas 2 will be placed on Canvas 1 and so forth. a) Is there a way I can create a single image (using toDataURL()) of all of these canvases keeping the same order? b) And, then how can I copy this image to a clipboard so that it can be pasted in other applications? 回答1: Steps: Create a new Canvas (maybe hidden) Copy both canvas to the new canvas Copy to image using canvas.toDataURL() See this

copy HTML text using the clipboard javascript API

允我心安 提交于 2021-01-29 07:11:17
问题 I want to be able to copy images and HTML text and past it into my web application. I am using the clipboard API to do so and my code works fine for images, for which I use: clipboard API read But for text, I am using this: clipboard API readText And I am only able to paste the raw text, not the HTML formatted text. Any help appreciated. 回答1: This should already be possible in Safari and Chrome Canary, by simply calling navigator.clipboard.write with text/html , just like you currently do so

Java intellij clipboard backup

霸气de小男生 提交于 2021-01-28 20:34:11
问题 I am writing a program operating on clipboard, and I want to make backup of clipboard contents at startup, and restore it when finished. So it looks like: data = Toolkit.getDefaultToolkit.getSystemClipboard.getContents(this); doSomething(); Toolkit.getDefaultToolkit.getSystemClipboard.setContents(data, this); it works fine in general, but when I copy a part of code from Intellij, and run my program, it throws: Exception "java.lang.ClassNotFoundException: com/intellij/codeInsight/editorActions

How to copy markup - not just plain text - to the clipboard using legacy free JavaScript

笑着哭i 提交于 2021-01-28 06:12:00
问题 The complete content of a <div> <div id="myElement"> Mary had a little <b>lamb</b>, its <i>fleece</i> was white as snow. Everywhere that mary went, the lamb was sure to go. </div> should be copied to the clipboard using this code const copyAll = document.querySelector("myElement"); window.getSelection().selectAllChildren(copyAll); document.execCommand("Copy"); window.getSelection().removeAllRanges(); (For the execCommand to work, the call must be executed via an event listener) But only the

Properly using AddClipboardFormatListener and subscribing to WM_CLIPBOARDUPDATE message

我与影子孤独终老i 提交于 2021-01-28 05:25:41
问题 I am currently attempting to use the Windows clipboard and its notifications in my application. Specifically, I am attempting to subscribe to the WM_CLIPBOARDUPDATE window message by using the AddClipboardFormatListener() function. Previously, I had been using the SetClipboardViewer() function in order to add my window directly into the clipboard viewer chain. This had worked just fine, and I had received the relevant messages WM_DRAWCLIPBOARD and WM_DESTROYCLIPBOARD when expected. However, I

How do non-window program monitor system clipboard?

十年热恋 提交于 2021-01-27 16:02:09
问题 I want to write a program to monitor windows clipboard using C#. I found some post about this topic. According thread How to monitor clipboard content changes in C#? and Finding the handle to a WPF window, I write a demo using WPF. In all samples code I found, all of them are WinForm or WPF apps, and win32 api they interop with need window handle as parameters. Such as api function SetClipboardViewer(HWND hWndNewViewer) But in my scenario, I need my program run background as a service to

How do non-window program monitor system clipboard?

我的未来我决定 提交于 2021-01-27 15:56:49
问题 I want to write a program to monitor windows clipboard using C#. I found some post about this topic. According thread How to monitor clipboard content changes in C#? and Finding the handle to a WPF window, I write a demo using WPF. In all samples code I found, all of them are WinForm or WPF apps, and win32 api they interop with need window handle as parameters. Such as api function SetClipboardViewer(HWND hWndNewViewer) But in my scenario, I need my program run background as a service to

How do non-window program monitor system clipboard?

99封情书 提交于 2021-01-27 15:53:14
问题 I want to write a program to monitor windows clipboard using C#. I found some post about this topic. According thread How to monitor clipboard content changes in C#? and Finding the handle to a WPF window, I write a demo using WPF. In all samples code I found, all of them are WinForm or WPF apps, and win32 api they interop with need window handle as parameters. Such as api function SetClipboardViewer(HWND hWndNewViewer) But in my scenario, I need my program run background as a service to

Markdown to clipboard as rich text

六眼飞鱼酱① 提交于 2021-01-27 13:30:58
问题 Using Python on Windows, I am trying to take a Markdown file and stick it into my clipboard as rich text. Most of the pieces of the puzzle are easy enough. Parsing the Markdown to HTML: No probs. Putting stuff into the clipboard via TKinter: Yup. But it's that middle part I just can't seem to crack. The steps I am missing are: From HTML to rich text, and then Rich text into clipboard. Is this even possible, or is it too big a leap? 来源: https://stackoverflow.com/questions/20103194/markdown-to

Get Formatted Cell Values efficiently

倖福魔咒の 提交于 2021-01-27 04:28:10
问题 I would like to be able to efficiently retrieve a multi-dimensional array of formatted cell values from Excel. When I say formatted values, I mean I would like to get them exactly as they appear in Excel with all the cell NumberFormat applied. The Range.Value and Range.Value2 properties work great for retrieving the cell values of a large number of cells into a multi-dimensional array. But those are the actual cell values (well at least with Range.Value2 is, I'm not quite sure what Range