Sets or retrieves the scale factor of the HTML rendering window. Default is 1.0.
Sets or retrieves the scale factor of the HTML rendering window. Default is 1.0.
Visual Basic |
---|
Public Property Zoom As Double |
Zoom property affects the scale of the HTML rendering output bitmap without overwriting DOM values such as CSS3 scale transformation or body zoom attribute. You should change the zoom scale by 20% intervals, that is by +/- 0.2, with lowest acceptable scale factor value being 0.2.
Zoom performance and function is affected by DPI awareness of your executable and you should consider making test on both normal-dpi and high-dpi screens. There is no generalized guide on how to use Zoom property as it greatly depends on your application's objectives and the combination of your script libraries and the dpi-awareness of your executable.
Private Sub WebKitX1_OnKeyPress(ByVal BrowserID As Long, ByVal Modifiers As Long, ByVal WindowsKeyCode As Long, ByVal NativeKeyCode As Long, ByVal IsSystemKey As Boolean, ByVal EventCharacter As String, ByVal UnmodifiedCharacter As String, ByVal IsFocusOnEditableField As Boolean) Dim Zoom As Double If WindowsKeyCode = 116 Then WebKitX1.Reload True End If Select Case EventCharacter ' Set zoom to 100% Case "=": WebKitX1.Zoom = 1 ' Increase zoom by +20% Case "+": Zoom = WebKitX1.Zoom WebKitX1.Zoom = Zoom + 0.2 ' Decrease zoom by -20% Case "-": Zoom = WebKitX1.Zoom WebKitX1.Zoom = Zoom - 0.2 Case "*" WebKitX1.Eval "document.body.style.cssText='transform:scale3d(0.5, 0.5, 0.5);'" End Select End Sub