Sub LWM_OffsetChanged (Engine As LWEngine)
If image.IsInitialized AND resized.IsInitialized = False Then
resized = ResizeImage(image, Engine.FullWallpaperWidth, Engine.FullWallpaperHeight)
End If
If resized.IsInitialized Then
Engine.Rect.Left = -(Engine.FullWallpaperWidth - actualImageWidth) / 2
Engine.Rect.Top = 0
Engine.Rect.Right = Engine.Rect.Left + Engine.FullWallpaperWidth
Engine.Rect.Bottom = Engine.FullWallpaperHeight
'Engine.Canvas.DrawBitmap(resized, Null, Engine.Rect)
If GetDeviceLayoutValues.Width > GetDeviceLayoutValues.Height Then
'Landscape
Engine.Canvas.DrawBitmapRotated(resized, Null, Engine.Rect, -90)
Else
'Portrait
Engine.Canvas.DrawBitmapRotated(resized, Null, Engine.Rect, 0)
End If
End If
Engine.RefreshAll
End Sub