1- First draw a rectangular selection in Photoshop and fill it with black. Note that it must be completely black. After customizing the brush, it will have 100% opacity.
2-Select "Edit/Define Brush" and enter the name in the pop-up dialog box. Press OK to complete the brush definition.
3- Select the new customized brush at the end of the brush list.
4-Select the brush editor, adjust the parameters, pay attention to the size and spacing of the pen tips, and use roundness to control the width of the dotted line. You can try it.
5-But in order for the dotted line to be consistent with the direction of the pen movement, the parameters in the "Dynamic Shape" item must be adjusted. Just select the direction in "Angle Control".
6-Self-portrait with dotted lines :D