In this use case, graphics of technical documentation are displayed using an image view.
To ensure multilingualism, the description texts are not contained in the graphic, but should be placed on the screen at runtime, depending on the language setting.
For example, "Lorem ipsum dolor sit amet" should be at position (1) and "Stet clita kasd gubergren" should be at position (2).
The whole thing should be as pixel-accurate as possible to the graphics, independent of the display characteristics of the end devices.
Since there is no experience with bitmaps, canvas or the like, a tip for the most sensible approach would be helpful.
To ensure multilingualism, the description texts are not contained in the graphic, but should be placed on the screen at runtime, depending on the language setting.
For example, "Lorem ipsum dolor sit amet" should be at position (1) and "Stet clita kasd gubergren" should be at position (2).
The whole thing should be as pixel-accurate as possible to the graphics, independent of the display characteristics of the end devices.
(The x,y coordinate were determined with https://www.mobilefish.com/services/record_mouse_coordinates/record_mouse_coordinates.php)
Since there is no experience with bitmaps, canvas or the like, a tip for the most sensible approach would be helpful.
Note: Labels created at runtime were tested, but appeared on different devices (5" and 10") at wrong positions.
B4X:
private Sub C0FillContentPage_Doc001[/INDENT]
c0tab4ImageView1.Gravity = Gravity.TOP
c0tab4ImageView1.Bitmap = LoadBitmapResize(File.DirAssets, "raptorengine01.png", c0tab4ImageView1.Width, c0tab4ImageView1.Height, True)
Dim ImageViewWidthRaw As Int = 300dip
Dim ScaleFactor As Float = (c0tab4ImageView1.Width / ImageViewWidthRaw )
For Each v As View In c0tab4BackPanel.GetAllViewsRecursive
If v Is Label Then
Dim labelX As Label = v
If labelX.Tag & "!" <> "!" Then
Dim tc As TextAtCoord = Starter.md.HandImageTexts.Get("k" & labelX.Tag)
If tc <> Null Then
labelX.Text = tc.Text
labelX.Left = c0tab4ImageView1.Left + tc.X * ScaleFactor
labelX.Top = c0tab4ImageView1.Top + tc.Y * ScaleFactor
labelX.TextSize = 12
labelX.Tag = tc
End If
End If
End If
Next
End Sub
Last edited: