DPI detection failed, fallback to 96 dpi

edited February 2017 in Using Processing

With processing 3.3 i got the following message when run a sketch from an external editor (notepad++ or VS Code):
DPI detection failed, fallback to 96 dpi.
Then, the sketch run normally.
Can anyone explain me what's going on ?
Thanks.

Answers

  • I have the same problem :( (Sublime Text and Atom) and the next text: Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native com.sun.jna.platform.win32.Shell32.(Shell32.java:32)

  • I have found this within the processing source code:
    WindowsPlatform.java

      public static int detectSystemDPI() {
        try {
          ExtUser32.INSTANCE.SetProcessDpiAwareness(ExtUser32.DPI_AWARENESS_SYSTEM_AWARE);
        } catch (Throwable e) {
          // Ignore error
        }
        try {
          ExtUser32.INSTANCE.SetThreadDpiAwarenessContext(ExtUser32.DPI_AWARENESS_CONTEXT_SYSTEM_AWARE);
        } catch (Throwable e) {
          // Ignore error (call valid only on Windows 10)
        }
        try {
          return ExtUser32.INSTANCE.GetDpiForSystem();
        } catch (Throwable e) {
          // DPI detection failed, fall back with default
          System.out.println("DPI detection failed, fallback to 96 dpi");
          return -1;
        }
      }
    
  • edited May 2017

    @jeremydouglass: no. yes. I will do this as soon as possible. Done :-)

Sign In or Register to comment.