Hi,
I am using this code (see below). Everything is fine. But when I use a picture in landscape format, it is distorted and rotated. Drawbitmaprotated instead of drawbitmap, the proportions are also wrong.
The picture was taken with the camera, should fit on the screen.
Thanks
Peter
I am using this code (see below). Everything is fine. But when I use a picture in landscape format, it is distorted and rotated. Drawbitmaprotated instead of drawbitmap, the proportions are also wrong.
The picture was taken with the camera, should fit on the screen.
Thanks
Peter
B4X:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim bitbg As Bitmap
Dim bdwBackground As BitmapDrawable
Dim pnl As Panel
Dim cvs As Canvas
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
bitbg.Initialize(File.DirAssets,"Rose2.jpg" )
pnl.Initialize("pnl")
Activity.AddView(pnl, 0, 0, 100%x, 100%y)
Dim rectDest As Rect
rectDest.Initialize(0, 0, pnl.Width, pnl.Height)
cvs.Initialize (pnl)
cvs.DrawBitmap(bitbg, Null, rectDest)
cvs.DrawText ("test", 120dip, 120dip, Typeface.DEFAULT_BOLD, 50, Colors.Blue, "LEFT")
...