Copy graphical style of Slider2D

Slider2D@{.5,.5} makes a draggable orange point with gray lines in a square.

I want to use that dot in my plots. I also want to use that color and thickness of gray line. I could extract all of this information approximately from the image. But I think there's a way to get the pieces used to construct that object in a way analagous to FullForm@Slider2D@{.5,.5} (this code of course does not yield a list of lines, other graphics primitives etc.). Perhaps the solution involves FullGraphics or AbsoluteOptions or AbsoluteCurrentValue.

The orange png image used as slider thumb:

slider2dThumb = Import["C:\\Program Files\\Wolfram Research\\Mathematica\\11.3\\SystemFiles\\FrontEnd\\SystemResources\\\
Bitmaps\\Typeset\\Slider2D\\ThumbLarge.png"]


GrayLevel graphics objects:

FrontEndResource["SliderThumb2D"] // Short


RawBoxes /@ {FrontEndResource["SliderThumb2D"],
FrontEndResource["SliderBackground2D"],
FrontEndResource["SliderBar2DHorizontal"],
FrontEndResource["SliderBar2DVertical"]}


• Is there documentation for FrontEndResource? In my version, 12.1, I can't find FrontEndResource even in Names["FrontEnd*"]
Mar 23 at 2:23
• No, it is not documented. Mar 23 at 2:39
• @Adam, it is one of those undocumented internal functions. For related Q/As on this site, see, for example, Complete list of FrontEndResources.
– kglr
Mar 23 at 2:50

I don't think this is actually made with Wolfram graphics primitives, but you can still find the image it uses! Open the application package and navigate to Contents > SystemFiles > FrontEnd > SystemResources > Bitmaps > Typeset > Slider2D. (That's where the orange disk is on a Mac, anyway.) You have a choice of different sizes.

I found what might be the rest of the information in the file Contents > SystemFiles > FrontEnd > TextResources > Controls.tr. If you find Slider2D in that document, you can see that the resource SliderBar2DHorizontal, for example, is given as

GraphicsBox[{GrayLevel[0.65], AbsoluteThickness[1.5],
LineBox[{{0, 0}, {4, 0}}]}, PlotRange -> {{-0.25, 4.25}, {-0.3, 0.3}}]


GraphicsBox is a lower-level undocumented form of Graphics that represents graphics as an expression per se, so applying ToExpression or, to be more precise, RawBoxes, works.

Edit: Also see @klgr's answer for a demonstration of using FrontEndResource within Mathematica to get this information! :)

• ah...klgr beat me by about 10 seconds, looks like! well, their answer is more comprehensive anyway, given that it employs FrontEndResource. Though, I suppose it doesn't mention the file Controls.tr, so I've at least contributed something... :) Mar 23 at 2:03
• I've never gone spelunking in /opt/Mathematica before, thank you for the intro! (unix master race)
• Ah, is it under /opt for you? (Are you on Linux?) For me it's literally inside the application itself! Mar 23 at 3:08
• The Mac toolbar is full of surprises! I don't have Controls in my Notebook -- nice to have find / -name "Controls.tr"` in a linux bash shell though.