Skip to main content
replaced http://meta.mathematica.stackexchange.com/ with https://mathematica.meta.stackexchange.com/
Source Link

#Update#

It's probably easier to use Edit -> Copy As -> Bitmap from the menubar. Changing the magnification of the notebook will change the size of the image that gets sent to the clipboard

#Previous answer#

There's likely a better answer out there, but I use a hack of the SEUploaderSEUploader to do this.

toclipboard2[] := If[
  MemberQ[Hold[{}, $Failed, NotebookRead[$Failed]], 
  NotebookRead[SelectedNotebook[]]],
     $Failed, (* there was nothing selected *)
     Module[{tag},
        FrontEndExecute[
        FrontEndToken[FrontEnd`SelectedNotebook[], "CopySpecial" , 
        If[$OperatingSystem === "Windows", "MGF" , "TIFF" ]]];
           Catch[
             NotebookGet@ClipboardNotebook[] /.
                r_RasterBox :> Block[{},
           Throw[Image[First[r], "Byte" , ColorSpace -> "RGB"], tag] /; True];
             $Failed, tag
           ]
        ]
      ];
CreatePalette[Button["clip", toclipboard2[]]]

This is the relevant section (the original function name is rasterizeSelection2). I'm assuming you are on a Windows platform, so this function should work for you.

To use, execute the code, and a very small palette will appear. Highlight the cell you want to copy and click the "clip" button in the palette. Paste away.

Note: I do use this function blindly; I don't understand all the ins and outs. @Szabolics can perhaps chime in and suggest why this is a good/bad idea.

#Update#

It's probably easier to use Edit -> Copy As -> Bitmap from the menubar. Changing the magnification of the notebook will change the size of the image that gets sent to the clipboard

#Previous answer#

There's likely a better answer out there, but I use a hack of the SEUploader to do this.

toclipboard2[] := If[
  MemberQ[Hold[{}, $Failed, NotebookRead[$Failed]], 
  NotebookRead[SelectedNotebook[]]],
     $Failed, (* there was nothing selected *)
     Module[{tag},
        FrontEndExecute[
        FrontEndToken[FrontEnd`SelectedNotebook[], "CopySpecial" , 
        If[$OperatingSystem === "Windows", "MGF" , "TIFF" ]]];
           Catch[
             NotebookGet@ClipboardNotebook[] /.
                r_RasterBox :> Block[{},
           Throw[Image[First[r], "Byte" , ColorSpace -> "RGB"], tag] /; True];
             $Failed, tag
           ]
        ]
      ];
CreatePalette[Button["clip", toclipboard2[]]]

This is the relevant section (the original function name is rasterizeSelection2). I'm assuming you are on a Windows platform, so this function should work for you.

To use, execute the code, and a very small palette will appear. Highlight the cell you want to copy and click the "clip" button in the palette. Paste away.

Note: I do use this function blindly; I don't understand all the ins and outs. @Szabolics can perhaps chime in and suggest why this is a good/bad idea.

#Update#

It's probably easier to use Edit -> Copy As -> Bitmap from the menubar. Changing the magnification of the notebook will change the size of the image that gets sent to the clipboard

#Previous answer#

There's likely a better answer out there, but I use a hack of the SEUploader to do this.

toclipboard2[] := If[
  MemberQ[Hold[{}, $Failed, NotebookRead[$Failed]], 
  NotebookRead[SelectedNotebook[]]],
     $Failed, (* there was nothing selected *)
     Module[{tag},
        FrontEndExecute[
        FrontEndToken[FrontEnd`SelectedNotebook[], "CopySpecial" , 
        If[$OperatingSystem === "Windows", "MGF" , "TIFF" ]]];
           Catch[
             NotebookGet@ClipboardNotebook[] /.
                r_RasterBox :> Block[{},
           Throw[Image[First[r], "Byte" , ColorSpace -> "RGB"], tag] /; True];
             $Failed, tag
           ]
        ]
      ];
CreatePalette[Button["clip", toclipboard2[]]]

This is the relevant section (the original function name is rasterizeSelection2). I'm assuming you are on a Windows platform, so this function should work for you.

To use, execute the code, and a very small palette will appear. Highlight the cell you want to copy and click the "clip" button in the palette. Paste away.

Note: I do use this function blindly; I don't understand all the ins and outs. @Szabolics can perhaps chime in and suggest why this is a good/bad idea.

Updated based on conversations in chatroom
Source Link
bobthechemist
  • 19.8k
  • 4
  • 56
  • 140

#Update#

It's probably easier to use Edit -> Copy As -> Bitmap from the menubar. Changing the magnification of the notebook will change the size of the image that gets sent to the clipboard

#Previous answer#

There's likely a better answer out there, but I use a hack of the SEUploader to do this.

toclipboard2[] := If[
  MemberQ[Hold[{}, $Failed, NotebookRead[$Failed]], 
  NotebookRead[SelectedNotebook[]]],
     $Failed, (* there was nothing selected *)
     Module[{tag},
        FrontEndExecute[
        FrontEndToken[FrontEnd`SelectedNotebook[], "CopySpecial" , 
        If[$OperatingSystem === "Windows", "MGF" , "TIFF" ]]];
           Catch[
             NotebookGet@ClipboardNotebook[] /.
                r_RasterBox :> Block[{},
           Throw[Image[First[r], "Byte" , ColorSpace -> "RGB"], tag] /; True];
             $Failed, tag
           ]
        ]
      ];
CreatePalette[Button["clip", toclipboard2[]]]

This is the relevant section (the original function name is rasterizeSelection2). I'm assuming you are on a Windows platform, so this function should work for you.

To use, execute the code, and a very small palette will appear. Highlight the cell you want to copy and click the "clip" button in the palette. Paste away.

Note: I do use this function blindly; I don't understand all the ins and outs. @Szabolics can perhaps chime in and suggest why this is a good/bad idea.

There's likely a better answer out there, but I use a hack of the SEUploader to do this.

toclipboard2[] := If[
  MemberQ[Hold[{}, $Failed, NotebookRead[$Failed]], 
  NotebookRead[SelectedNotebook[]]],
     $Failed, (* there was nothing selected *)
     Module[{tag},
        FrontEndExecute[
        FrontEndToken[FrontEnd`SelectedNotebook[], "CopySpecial" , 
        If[$OperatingSystem === "Windows", "MGF" , "TIFF" ]]];
           Catch[
             NotebookGet@ClipboardNotebook[] /.
                r_RasterBox :> Block[{},
           Throw[Image[First[r], "Byte" , ColorSpace -> "RGB"], tag] /; True];
             $Failed, tag
           ]
        ]
      ];
CreatePalette[Button["clip", toclipboard2[]]]

This is the relevant section (the original function name is rasterizeSelection2). I'm assuming you are on a Windows platform, so this function should work for you.

To use, execute the code, and a very small palette will appear. Highlight the cell you want to copy and click the "clip" button in the palette. Paste away.

Note: I do use this function blindly; I don't understand all the ins and outs. @Szabolics can perhaps chime in and suggest why this is a good/bad idea.

#Update#

It's probably easier to use Edit -> Copy As -> Bitmap from the menubar. Changing the magnification of the notebook will change the size of the image that gets sent to the clipboard

#Previous answer#

There's likely a better answer out there, but I use a hack of the SEUploader to do this.

toclipboard2[] := If[
  MemberQ[Hold[{}, $Failed, NotebookRead[$Failed]], 
  NotebookRead[SelectedNotebook[]]],
     $Failed, (* there was nothing selected *)
     Module[{tag},
        FrontEndExecute[
        FrontEndToken[FrontEnd`SelectedNotebook[], "CopySpecial" , 
        If[$OperatingSystem === "Windows", "MGF" , "TIFF" ]]];
           Catch[
             NotebookGet@ClipboardNotebook[] /.
                r_RasterBox :> Block[{},
           Throw[Image[First[r], "Byte" , ColorSpace -> "RGB"], tag] /; True];
             $Failed, tag
           ]
        ]
      ];
CreatePalette[Button["clip", toclipboard2[]]]

This is the relevant section (the original function name is rasterizeSelection2). I'm assuming you are on a Windows platform, so this function should work for you.

To use, execute the code, and a very small palette will appear. Highlight the cell you want to copy and click the "clip" button in the palette. Paste away.

Note: I do use this function blindly; I don't understand all the ins and outs. @Szabolics can perhaps chime in and suggest why this is a good/bad idea.

Source Link
bobthechemist
  • 19.8k
  • 4
  • 56
  • 140

There's likely a better answer out there, but I use a hack of the SEUploader to do this.

toclipboard2[] := If[
  MemberQ[Hold[{}, $Failed, NotebookRead[$Failed]], 
  NotebookRead[SelectedNotebook[]]],
     $Failed, (* there was nothing selected *)
     Module[{tag},
        FrontEndExecute[
        FrontEndToken[FrontEnd`SelectedNotebook[], "CopySpecial" , 
        If[$OperatingSystem === "Windows", "MGF" , "TIFF" ]]];
           Catch[
             NotebookGet@ClipboardNotebook[] /.
                r_RasterBox :> Block[{},
           Throw[Image[First[r], "Byte" , ColorSpace -> "RGB"], tag] /; True];
             $Failed, tag
           ]
        ]
      ];
CreatePalette[Button["clip", toclipboard2[]]]

This is the relevant section (the original function name is rasterizeSelection2). I'm assuming you are on a Windows platform, so this function should work for you.

To use, execute the code, and a very small palette will appear. Highlight the cell you want to copy and click the "clip" button in the palette. Paste away.

Note: I do use this function blindly; I don't understand all the ins and outs. @Szabolics can perhaps chime in and suggest why this is a good/bad idea.