How to? Screen capture with color

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
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.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,460
88
Albuquerque, NM
prospero.unm.edu
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.)
 
Jan 19, 2011
604
14
Norman, OK
@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.
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
The forum blocks highlighting and other formatting. However, pasting into email or pasting into Word docs does keep it.
 
May 20, 2008
11,400
99
Syracuse, NY, USA
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.
 
Jan 19, 2011
604
14
Norman, OK
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
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
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.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,460
88
Albuquerque, NM
prospero.unm.edu
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?)
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
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.
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
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]
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
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
Thread starter Title Forum Replies Date
J Screen Capture (Console Mode) Support 5
M No line wraps if last line of the screen buffer is reached Support 5
krischik Take Command opens with (almost) white screen and then hangs Support 3
O Why this screen? Support 10
M TCC screen text bright colors not as bright in 24 as 23 Support 5
vefatica Win10, alternative screen buffer, cursor doesn't blink Support 11
R Vertical scroll bar disappeared with SCREEN Support 6
T How to? Show the values of batch variables on the TCC screen Support 21
T How to? Off screen move? Support 3
G Odd problem - screen brightness Support 4
R Find in screen buffer - find next behavior Support 0
fishman@panix.com Can I start TCC in full screen mode? Support 9
G Linux curses (full screen) crashes TC Support 1
L w10 - half screen Support 2
I TC "Registering" but NOT Registering, Now Hung on TCMD Option Screen Support 2
Jay Sage Ctrl-C Not Working Reliably to Copy Screen Content Support 4
L Full Screen in Office 2013 theme chars missing Support 8
H V15 installer difficult to use with JAWS screen reader Support 0
knudvaneeden cls in TakeCommand screen does not clear full screen Support 26
G WAD Pipe clears screen Support 2
S How to? enable or disable screen saver password Support 5
J Color command and Screen Buffer. Support 2
H VIEW not "screen reader friendly: Support 7
fishman@panix.com Is there a way to get the HELP screen to open maximized? Support 4
O Pausing screen? Support 2
J Utility to Save/Restore current screen Support 16
Joe Caverly Clearing a section of the screen works in CMD, not in TC Support 2
Roedy Screen background colours Support 1
A TakeCommand screen width Support 1
I Environment variable in OPTION screen? Support 2
G Cls Does not appear to clear screen Support 8
D TCC - Full Screen/History window conflict - workaround? Support 4
Mordachai How to capture all console output from a TCMD session? Support 4
C How to? Capture keystrokes? Support 1
Dick Johnson Weird Color Problem Support 8
vefatica ECHOERR and color escape sequences Support 4
gentzel TCMD background color confusion Support 6
M TCC color issue in ConEmu Support 4
vefatica IDE external command syntax color? Support 1
B Problem with color in nested shells Support 1
Alpengreis WAD [v26 Beta RC3]: MSGBOX color problems Support 4
T TCC Window Background Color Anomaly Support 9
AndrewJ TakeCommand v23 + ANSI color sequences leads to black on black text Support 6
K TCC prompt background color Support 4
P Color directories in Win10 build 10586 console Support 11
jbanaszczyk color 00 Support 8
V TCC17 background color problem Support 2
D Highlighted Text Color? Support 2
gschizas (minor) Help topic "Colors, Color Names and Codes" is wrong Support 0
L How to get color into file names? Support 4

Similar threads