Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? Screen capture with color

samintz

Scott Mintz
May
1,582
27
Someone at some point in the past used to do screen captures with either ANSI or RTF/HTML codes to capture not only the text but the colors as well.

Was that a plugin or external tool? How can I do that? I don't want a Print-Screen graphic.
 
Any chance you'd be willing to update it to support RTF screen capture (using a hot-key)?
 
Sounds like it might be a fun project. It would probably be a different plugin, though.

(What are you trying to do? If you want to save the console buffer and restore it later, Vincent and I both have plugins to do that.)
 
Screen captures of snippets to paste into email mostly (or even this forum).
 
@samintz could you demonstrate some RTF color pasting? Here's a sample screenshot from Word.

upload_2017-1-5_9-57-53.png


Here's the same text copied and pasted from Word. It keeps the formatting, but no colors.

Normal. Bold. Italics. Underlined. Highlighted. Red. Yellow. Blue.
 
The forum blocks highlighting and other formatting. However, pasting into email or pasting into Word docs does keep it.
 
This page is mildly interesting.
[title]
If Winword uses RTF, it would seem Winword registered it. It'd be no surprise then if Outlook also registered it. Can you copy from Winword and paste to a non-Office app?
This page is also interesting.
https://support.microsoft.com/en-us/kb/258513
It gives an example from VB.
The hard part might well be turning the selection into RTF in the first place.
 
Yeah, it works pasting into Word/Outlook. I tinkered a little with the Charles' HTMLDUMP and it does a good job. I've used it in the past to make documentation from command line help and wrote a BTM file (call all the help commands into the console) and a couple of SED scripts to clean up the HTML output from it.

This is a raw paste from either's HTML output or directly from the console.

Code:
   prints the supplied string to terminal, which may contain color patterns:

      [Red],[Green],[Blue],[Yellow],[Cyan],[Magenta]   (bright)
      [red],[green],[blue],[yellow],[cyan],[magenta]   (dark)
        print the following text in the selected color.

      [def]
        switch back to default color.

The original console HTMLDUMP output pastes without the finer coloring (top), however, after I ran it through my routine (bottom) it displays nicely.

upload_2017-1-5_14-30-18.png
 
HTMLDUMP does what I want with the caveat that it captures the entire console buffer. I want to select text with my mouse and copy it.

I'm not opposed to a TCMD-only solution. HTMLDUMP works in both TCC and TCMD.
 
HTMLDUMP does what I want with the caveat that it captures the entire console buffer. I want to select text with my mouse and copy it.

I'm putting up a new build with an option to dump only the visible region of the buffer. (If you select with the mouse, doesn't that temporarily lose the color?)
 
Yes. But the same visual behavior happens in Word if you select text. I assume the colors are saved somewhere so they can be restored.
 
I just tried your tool. If I redirect the output to CLIP: and paste the result I get raw HTML. If I send the output to a file an open the file in Chrome it renders as formatted text. If I copy *that* text the clipboard contains a new entry type. I assume 0xC11E is CF_HTML.
Code:
Clipboard Open
There are 5 clipboard formats.
9438 (0xC11E) - UNKNOWN
  13 (0x0D) - CF_UNICODETEXT
  16 (0x10) - CF_LOCALE
   1 (0x01) - CF_TEXT
   7 (0x07) - CF_OEMTEXT
Clipboard Closed

This MSDN arfticle describes the CF_HTML clipboard format: [HTML Clipboard Format]
 
Internet Explorer 11 puts even more into the clipboard:
Code:
Clipboard Open
There are 9 clipboard formats.
49161 (0xC009) - DATAOBJECT
    1 (0x0001) - CF_TEXT
   13 (0x000D) - CF_UNICODETEXT
49438 (0xC11E) - CF_HTML
49313 (0xC0A1) - UNKNOWN
50038 (0xC376) - UNKNOWN
49171 (0xC013) - Ole Private Data
   16 (0x0010) - CF_LOCALE
    7 (0x0007) - CF_OEMTEXT
Clipboard Closed
 

Similar threads

Back
Top