0

How does VSCode achieve a low intensity shadow compared to other apps like file explorer and how could I achieve the same for my borderless window?

VScode:

enter image description here

File Explorer:

enter image description here

nico.user
  • 483
  • 2
  • 5
  • 15
  • You can use a two-layer form, draw the shadows in OnPaint. – Junjie Zhu - MSFT Feb 11 '22 at 07:04
  • 1
    The shadows are identical. 13 pixels wide, with these gray values: CD, D5, DF, E6, EC, F1, F6, F8, FA, FB, FC, FD, FE. – Dialecticus Feb 11 '22 at 12:52
  • @Dialecticus But how did they change the shadows gray values? – nico.user Feb 11 '22 at 16:02
  • They did not change the values. The values are identical. Open both images in Paint.NET, or some other proper image editor, use color picker tool, and sample the pixels. Colors are identical in both images, and they are given in my previous comment. – Dialecticus Feb 11 '22 at 16:41
  • So, when you say "VSCode does it differently from all other applications", that statement is not correct. VSCode does it the same, and it's not VSCode that does it, but the Windows itself. – Dialecticus Feb 11 '22 at 16:43
  • You can create 4 [layered-windows](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-updatelayeredwindow) and synchronize them with the position of your window and its size. [Visual Studio](https://stackoverflow.com/questions/12478717/how-does-visual-studio-2012-draw-its-window-border?noredirect=1&lq=1) does that by so. – jtxkopt Feb 11 '22 at 17:12
  • @Dialecticus I don't think that is correct. When I have VSCode next to another app, the shadows are clearly visually different. – nico.user Feb 11 '22 at 17:27
  • @nico.user I don't know what is clear on your screen, but I know how to compare pixels in Paint.NET. Shadows in two images that you provided are identical when compared in Paint.NET pixel by pixel. – Dialecticus Feb 11 '22 at 17:34
  • @Dialecticus Sorry, you are right. I saw an optical illusion because of dark mode. – nico.user Feb 11 '22 at 17:46

0 Answers0