Hi,
I need help to scale the background images for my live wallpaper.
I take a random flyer from my site with the url:
>> http://.../electronic/fcDownload.php (only some test flyer available)
In the attachments, I uploaded my project (construction area - haha! - not all will work correctly. If all things are done, I will upload and share the code in "Basic4android Share Your Creations"! Promise!)
In the WallpaperService I need to scale the backgroundimage with the right ratio. I need this dynamicly, because not all flyer have the same scaling.
This works good, but all images on my GNex or N7 are clinched. I think it is a problem with "FullWallpaperHeight" (=1280). But on both devices, I have software buttons they must be subtracted from the "FullWallpaperHeight".
I test it with
But I have no Idea with the nice offset x/y. So, please :sign0085:
Regards,
trebun
I need help to scale the background images for my live wallpaper.
I take a random flyer from my site with the url:
>> http://.../electronic/fcDownload.php (only some test flyer available)
In the attachments, I uploaded my project (construction area - haha! - not all will work correctly. If all things are done, I will upload and share the code in "Basic4android Share Your Creations"! Promise!)
In the WallpaperService I need to scale the backgroundimage with the right ratio. I need this dynamicly, because not all flyer have the same scaling.
B4X:
Sub LWM_OffsetChanged (Engine As LWEngine)
If Flyer.IsInitialized Then
Engine.Rect.Left = -Engine.CurrentOffsetX
Engine.Rect.Top = -Engine.CurrentOffsetY
Engine.Rect.Right = -Engine.CurrentOffsetX + Engine.FullWallpaperWidth
Engine.Rect.Bottom = -Engine.CurrentOffsetY + Engine.FullWallpaperHeight
Engine.Canvas.DrawBitmap(Flyer, Null, Engine.Rect)
Else
Engine.Canvas.DrawColor(Colors.Black)
Engine.Canvas.DrawText(AResMap.Get("other_placeholder_on_screen"), 120dip, 120dip, Typeface.DEFAULT_BOLD, 30, Colors.White, "LEFT")
End If
Engine.RefreshAll
End Sub
This works good, but all images on my GNex or N7 are clinched. I think it is a problem with "FullWallpaperHeight" (=1280). But on both devices, I have software buttons they must be subtracted from the "FullWallpaperHeight".
I test it with
B4X:
pScreenHeight=GetDeviceLayoutValues.Height
pScreenWidth=GetDeviceLayoutValues.Width
But I have no Idea with the nice offset x/y. So, please :sign0085:
Regards,
trebun
Attachments
Last edited: