Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Explicit
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Private Declare Function SetStretchBltMode Lib "gdi32" (ByVal hdc As Long, ByVal nStretchMode As Long) As Long
Private Enum StretchMode
BLACKONWHITE = 1
WHITEONBLACK = 2
COLORONCOLOR = 3
HALFTONE = 4
End Enum
Private Sub Command1_Click()
Dim Stretch As StretchMode
For Stretch = BLACKONWHITE To HALFTONE
SetStretchBltMode Form1.hdc, Stretch
StretchBlt Form1.hdc, 0, (Stretch - 1) * 150, 100, 100, Picture1.hdc, 0, 0, 200, 200, vbSrcCopy
Next
End Sub
Private Sub Form_Load()
Form1.AutoRedraw = False ' ensure this, as autoredraw true resets stretchmode
' Rough and ready resizing just for the sake of this example
Picture1.Left = 100 * Screen.TwipsPerPixelX
Picture1.Width = 200 * Screen.TwipsPerPixelX
Picture1.Height = 200 * Screen.TwipsPerPixelY
Form1.Height = 650 * Screen.TwipsPerPixelY
Form1.Width = 110 * Screen.TwipsPerPixelX + Picture1.Width
End Sub