Enables support for High DPI monitors in host application's current process.
Enables support for High DPI monitors in host application's current process.
Visual Basic |
---|
Public Sub EnableHighDPISupport() |
WebKitX ActiveX is an in-process ActiveX Control that uses out-of-process CEF3 processes for rendering HTML5.
Even though CEF3 is high-dpi-aware, you must make sure that your executable is also high-dpi-aware.
In order to aid you enabling this feature, WebKitX Interface offers the EnableHighDPISupport method that must be called on Form_OnLoad event handler, preferably before any other method call. This call will try to enable high-dpi-support in the current process hosting WebKitX ActiveX in-process portion of the control.
Please note this is helper function for languages such as VB6 and the call does not affect CEF3 client processes. To control High DPI support for entire WebKitX solution (ActiveX and CEF3 processes) you must do so in OnCreate event by setting Settings.enable_high_dpi_support.
Option Explicit Private Sub Form_Load() ' Enable High-DPI support in current process WebKitX1.EnableHighDPISupport End Sub Private Sub Form_Resize() On Error Resume Next WebKitX1.Move 0, 0, ScaleWidth, ScaleHeight Err.Clear End Sub Private Sub WebKitX1_OnCreate(ByVal Settings As WebKitXCEF3Lib.ISettings, CommandLineSwitches As String) Settings.plugins = False Settings.cache_path = App.Path + "\MyCache" Settings.application_cache = App.Path + "\MyAppCache" Settings.persist_session_cookies = 1 Settings.persist_user_preferences = 1 CommandLineSwitches = "" 'defaults End Sub Private Sub WebKitX1_OnBrowserReady() WebKitX1.Open "https://www.google.com" End Sub