clipboard

linux clipboard read/write in C

白昼怎懂夜的黑 提交于 2019-12-10 14:54:28
问题 I done lots of googling but I am still unsure on how to proceed. What's the most common way of reading/write to the clipboard under Linux? I want both support for Gnome & KDE desktops. Updated : do I take there isn't an easy solution and one must "aggregate" together multiple sources (gnome, kde) in order to craft a solution? 回答1: Maybe you can look at xclip and see how they have done it. It provides an interface to X selections ("the clipboard") from the command line. It can read data from

Copy string to clipboard, without using a DOM element?

折月煮酒 提交于 2019-12-10 14:39:56
问题 I have this code that works: let textarea = document.createElement('textarea'); textarea.setAttribute('type', 'hidden'); textarea.textContent = 'the string you want to copy'; document.body.appendChild(textarea); textarea.select(); document.execCommand('copy'); as you can see - I have the string to copy in hand. But I have to create a temporary hidden DOM element to score the string before copying to the clipboard. My question is, is there some API to copy to clipboard without needing the DOM

Saving image form Clipboard

做~自己de王妃 提交于 2019-12-10 14:38:40
问题 i want to save one Image inside clipboard in winrt to file. but i found no way. can you help please? var dataPackage = Clipboard.GetContent(); var t = await dataPackage.GetBitmapAsync(); var t2 = await t.OpenReadAsync(); t2.AsStream(); t2.Seek(0); BitmapImage bitmapImage = new BitmapImage(); bitmapImage.SetSource(t2); Image image = new Image(); image.Source = bitmapImage;< 回答1: Here you go :) Please note you can't use ANY folder to save. I have passed ApplicationData.Current.LocalFolder.Path

How do I get OpenXML onto the clipboard so that it will paste into Excel?

爱⌒轻易说出口 提交于 2019-12-10 14:05:09
问题 I am generating OpenXml using the DocumentFormat.OpenXML library from Microsoft. I am tring to figure out how to get this document into my clipboard so that I can paste my data into Excel (as if it were copied from Excel). I am able to see OpenXml formated data coming out of Excel, when I copy from within Excel. I need to do the reverse, copy out of a WPF application, and paste into Excel using advanced Excel formatting (hence needing OpenXML). Here is a snippet of what I have so far:

Paste text from Clipboard using button

痴心易碎 提交于 2019-12-10 13:59:12
问题 I have control bar buttons Copy, Cut, and Paste and they suppose to copy/paste some text/objects from and to clipboard. Copy/Cut works fine. Paste using CTRL+V and context menu works fine as well. But when I'm trying to access Clipboard via control bar button click handler it throws error SecurityError: Error #2179: The Clipboard.generalClipboard object may only be read while processing a flash.events.Event.PASTE event. at flash.desktop::Clipboard/getObjectReference() at flash.desktop:

Is there a Windows API to programmatically Cut / Copy / Paste files via Windows Explorer?

試著忘記壹切 提交于 2019-12-10 12:44:37
问题 I know that SHFileOperation can be used to perform file operatons with Windows Explorer, but it only performs complete file operations where both the source and destination are known. Is there an API that allows a application to cut, copy, or paste in Windows Explorer from an application? To answer a couple of questions: Using Windows Explorer to perform file/folder operations would greatly simplify moving multiple objects. This is particularly important for moving folders and their contents

New AVD takes a picture saves to clipboard

江枫思渺然 提交于 2019-12-10 11:39:19
问题 When I create a new Android Virtual Device and run it for the first time in Eclipse, I have noticed that it activates my webcam and takes a picture. This picture is saved to my clipboard. But I was wondering if this is normal and happens to anyone? INFO: Android Development Toolkit Version: 16.0.1.v201112150204-238534 Android 4.0.3 API level 15 Running on Windows XP EDIT: Tracked it down to what I think is the SDL_app process. Also when I disabled my clipboard and started it up I got this

How can I convert a CF_DIBV5 from Clipboard (Format17) to a Transparent Bitmap?

被刻印的时光 ゝ 提交于 2019-12-10 10:55:25
问题 GDI+ has not support to CF_DIBV5 format BUT when several applications put transparent images to clipboard they use CF_DIBV5 (Format 17) format to maintain Alpha Channel. .NET Framework can't handle CF_DIBV5 format so a .NET application can't put or retrieve alpha images to/from clipboard. Is there any c# code to support CF_DIBV5 to Bitmap transformation from Clipboard? 回答1: SORRY! I'm answering my own question: [StructLayout(LayoutKind.Sequential)] public struct BITMAPV5HEADER { public uint

Python get selected text

谁说胖子不能爱 提交于 2019-12-10 10:37:58
问题 How would I, using Python "catch" text that a user has selecting in, for example, a web browser? The script would idle in the background, and when a certain key combination is pressed, it "gets" the text the user has selected. Think copy & paste, only it copies to my application instead of a clipboard. Thanks! I'd like to point out that this will be for Mac. 回答1: Install xsel sudo apt-get install xclip xsel -y Save this as get-selected.py import os print(os.popen('xsel').read()) Select text

Paste clipboard content into a variable in bash using xclip

最后都变了- 提交于 2019-12-10 10:26:49
问题 I know this command will paste the clipboard contents into a file: xclip -out -selection clipboard >> file.txt If I want to paste clipboard content into a variable like a string what do I do? 回答1: To assign the output of a command to a variable, you can use command substitution: myvar=$( command ) echo "$myvar" 来源: https://stackoverflow.com/questions/23046580/paste-clipboard-content-into-a-variable-in-bash-using-xclip