GetLenString

Printer ››
Parent Previous Next

GetLenString

Синтаксис

Sub GetLenString(ByRef Str As String, ByRef X As Integer, ByRef Y As Integer)

Описание

Используется для получения длины строки в пикселах. Функция находится в пространстве имен window9

Параметры

Str - измеряемая строка

X,Y - буферы для получения ширины и высоты строки

Платформы

Windows

Пример

#Include "window9.bi"
Using window9
Dim Po As SinglePoint
Dim As String destST,tempST,SourceST="FreeBASIC is a self-hosting compiler which makes use of the GNU binutils programming tools as backends and can produce console, graphical/GUI executables, dynamic and static libraries."
Dim As Integer X,X1,Y,Y1
StartPrinter(@po)
FontDraw(LoadFont("Arial",22*po.x))
PageStart()
GetRealSize(x1,y1)
For a As Integer=0 To Len(SourceST)-1
  GetLenString(TempST+Chr(SourceST[a]),x,y)
  If x>=x1 Then
     DestST=DestST+TempST+!"\n\r"
     TempST=""
     a-=1
  Else
     TempST+=Chr(SourceST[a])
  EndIf
Next
DestST+=TempST
PrintText(DestST)
PageEnd()
StopPrinter()

Created with the Personal Edition of HelpNDoc: Easily create EPub books