' Kalibrierbild für "Auto"-Taste bei TFT-Bildschirm anzeigen #include "fbgfx.bi" Const ZEI_BREITE As Integer = 8 Const ZEI_HOEHE As Integer = 16 Dim Shared bx As Integer, by As Integer Dim sx As Integer, sy As Integer, t As String Dim i As Integer Function min (a As Integer, b As Integer)As Integer If a < b Then min = a Else min = b EndIf End Function Sub GeneriereBild (sx As Integer, sy As Integer) Dim x As Integer, y As Integer Cls For y = 0 To (by - 1) \ sy For x = 0 To (bx - 1) \ sx If (x + y And 1) = 1 Then Line(x * sx, y * sy)-(min((x + 1) * sx - 1, bx - 1), min((y + 1) * sy - 1, by - 1)), ,bf EndIf Next x Next y End Sub Sub ZeigeMittentext(txt As String) Dim zei(19) As String Dim i As Integer, j As Integer, a As Integer, lmax As Integer Dim px As Integer, py As Integer i = 1 a = 0 lmax = 0 Do j = InStr(i, txt, !"\n") If j > 0 Then zei(a) = Mid(txt, i, j - i) If Len(zei(a)) > lmax Then lmax = Len(zei(a)) EndIf a += 1 i = j + 1 EndIf Loop While j > 0 zei(a) = Mid(txt, i) If Len(zei(a)) > lmax Then lmax = Len(zei(a)) EndIf a += 1 py = 1 + (by \ ZEI_HOEHE - a) \ 2 px = 1 + (bx \ ZEI_BREITE - lmax) \ 2 Locate py - 1, px - 1 Print !"\201" + String(lmax, !"\205") + !"\187"; For i = 0 To a - 1 Locate py + i, px - 1 j = (lmax - Len(zei(i))) \ 2 Print !"\186" + Space(j) + zei(i) + Space(lmax - j - Len(zei(i))) + !"\186"; Next i Locate py + a, px - 1 Print !"\200" + String(lmax, !"\205") + !"\188"; End Sub ' Fenster im Vollbild ScreenControl FB.GET_DESKTOP_SIZE, bx, by ScreenRes bx, by, 4, ,FB.GFX_NO_FRAME ScreenControl FB.SET_WINDOW_POS, 0, 0 Width bx \ ZEI_BREITE, by \ ZEI_HOEHE If Command(1) <> "" Then i = InStr(Command(1), "x") If i > 0 Then sx = ValInt(Left(Command(1), i - 1)) sy = ValInt(Mid(Command(1), i + 1)) Else sx = ValInt(Command(1)) sy = sx EndIf Else sx = 1 sy = 1 EndIf If sx < 1 Or sx > 100 Or sy < 1 Or sy > 100 Then ZeigeMittentext "Aufrufformat: " + Command(0) + !" [ 1 Then sy -= 1 EndIf Case !"\255K" If sx > 1 Then sx -= 1 EndIf Case !"\255M" If sx < 100 Then sx += 1 EndIf Case !"\255P" If sy < 100 Then sy += 1 EndIf Case "+" If sx < 100 Then sx += 1 sy = sx EndIf Case "-" If sx > 1 Then sx -= 1 sy = sx EndIf End Select Loop Until t = !"\027" Or t = " " Or t = !"\013"