B4A Question [Solved] Horizontal customlistview with different text width in the item - DonManfred (first post)    
Jul 23, 2019I dont see any code? What did you tried so far? Note that the searchview code should reveal the solution as it is using such rounded objects...
https://www.b4x.com/android/forum/pages/results/?query=measure+textwidth...
link: As B4XView = lb
fnt = xlbl.Font
lb.Text = Text
Dim TextWidth As Int = MeasurementCanvas...
B4A Code Snippet [B4X] [XUI] Accurate Text Measurement and Drawing - Erel    
Dec 12, 2022   
(55 reactions).60 includes a new method named B4XCanvas.MeasureText. This method accurately measures single line strings.
It returns a B4XRect object with the width and height of the measured string. The Top field....MeasureText(Text, Fnt)
Dim BaseLine As Int = CenterY - r.Height / 2 - r.Top
cvs1.DrawText(Text, CenterX...
link: Fixed....
link:
Sub DrawTextWithBorder
Declare BaseLine as Double instead of Int, otherwise the result will not be accurate.
I tried it (B4J) wit...
Wish B4X XUI Add MeasureTextWidth and MeasureTextHeight to B4XCanvas - klaus    
Apr 13, 2018Hi Erel,
The title says the wish.
Currently, there are three different routines in the class with different results.
Example:
MeasureTextHeight("Mg") and MeasureTextHeight("M") give different results in B4A because the real height is different, but give the same result in B4J.
I have not checked with B4i....
B4A Question BBCodeview and AS_Radiobutton Height Problem - omo    
Apr 4, 2023:
140949
After these failed attempts, i tried to use MeasureTextHeight and MeasureTextwidth to compute...
B4J Tutorial [Server] Performance measures - Erel    
Feb 5, 2014   
(12 reactions)   
tags: ErelB4J server library is based on an open source project named Jetty.
Jetty server performance is excellent which means that B4J server performance is also excellent.
The following numbers are the result of a simple test where one program sends many requests to the server program. Both running on the same computer.
The actual numbers are not very important and should not be taken too seriously. The main point is that a B4J server can easily handle huge traffic.
The numbers were measured in...
B4J Code Snippet Measure Multiline Text Height - Erel    
Jun 11, 2020   
(9 reactions)Measuring the length of multiline text is simple in B4A with StringUtils.MeasureMultilineTextHeight... be set: https://www.b4x.com/android/forum/threads/measure-text.45750/#post-311358
Another option is to call a non-public API with the following code:
Sub MeasureMultilineTextHeight (Font As Font, Width...("MeasureMultilineTextHeight", Array(Font, Text, Width))
End Sub
#if Java
import java.lang.reflect... javafx.scene.text.TextBoundsType;
public static double MeasureMultilineTextHeight(Font f, String text...
B4i Question Create BMP, help porting this simple code in B4i - marcick    
Apr 18, 2025 = Typeface.DEFAULT_BOLD
Dim textWidth As Float = cvs.MeasureStringWidth(text, font, fontSize)
Dim textHeight As Float = cvs.MeasureStringHeight(text, font, fontSize)
Dim x As Float = (size - textWidth) / 2
Dim y As Float = (size + textHeight) / 2
cvs.DrawText(text, x, y, font, fontSize...
B4A Question Text Width?? - klaus (first post)    
May 21, 2012   
(4 reactions)You must initialize the Canvas:Dim C As Canvas
C.Initialize(Activity)
Dim X As Int
X = C.MeasureStringWidth("textwidth", default_font, 30)
Msgbox(x,"")Best regards....
link: As Canvas
Dim X As Int
X=C.MeasureStringWidth("textwidth",default_font,30)
Msgbox(x,"...
B4R Tutorial Inertial Measurements (MPU 6050) and Magnetometer (HMC5883L) - derez    
May 27, 2023   
(8 reactions)With big help from Erel here are two examples of connecting two boards by the I2C/TWI (A4 and A5 pins), using the rWire library.
Inertial Measurements (mpu6050) :
' MPU 6050 board - Inertial Measurements
' connect SCL to A5, SDA to A4, 3.3V and ground
#Region Project Attributes
#AutoFlushLogs: True
#StackBufferSize: 300
#End Region
Sub Process_Globals
Public Serial1 As Serial
Private wire As WireMaster
Private raf As RandomAccessFile
Private const MPU As Int = 0x68...
B4A Question b4xCanvas MeasureText (Multiline) - fbritop    
Jan 26, 2021Is it posible to calculate the height of a label and text, but with multiple lines? The way that b4i SizeToFit works I think.
Thanks
FBP...
Page: 1  
2  
3  
4  
5  
6  
7