B4A Code Snippet [B4X] MeasureMultilineTextHeight - Alexander Stolte    May 11, 2023   (15 reactions) import java.lang.reflect.Method; import javafx.scene.text.Font; import javafx.scene.text.TextBoundsType; public static double MeasureMultilineTextHeight(Font f, String text, double width) throws Exception { Method m = Class.forName("com.sun.javafx.scene.control.skin.Utils").getDeclaredMethod("comp B4A Question MeasureStringHeight - Alexander Stolte (first post)    Mar 02, 2024   (1 reaction) This is because this function is only for single-line text.
Use this code snipped:
https://www.b4x.com/android/forum/threads/b4x-measuremultilinetextheight.147933/#content
or use just this 2 lines:
Dim su As StringUtils
Return su.MeasureMultilineTextHeight(xLabel,xLabel.Text)
Note that it only wor B4A Question MeasureMultilineTextHeight measures too small with certain characters. - RB Smissaert    Sep 17, 2020 MeasureMultilineTextHeight works perfectly fine with with nearly anything I throw at it. Only exception is when the text for example contains char 9632. It then gives slightly too small values. This is not quite predictable, for example it can be fine if the last line in the view as little text. Is B4A Question MeasureMultilineTextHeight provides value which crops the text - epiCode    Jul 15, 2021 I'm having certain issues with StringUtils function MeasureMultilineTextHeight
Non-english language strings are cut off (example attached)
I tried adding some constant to returned value from function but it does not work when lines exceed.
Is this a specific language/font issue ?
Is there an other B4A Code Snippet [B4X] [XUI] Accurate Text Measurement and Drawing - Erel    Dec 12, 2022   (54 reactions) (It took me 7 years to get this one right.)
67684
https://www.b4x.com/basic4android/images/SS-2018-05-09_13.04.52.png
https://www.b4x.com/basic4android/images/SS-2018-05-09_13.05.38.png
XUI v1.60 includes a new method named B4XCanvas.MeasureText. This method accurately measures single line stri Share My Creation Image measurement tool - kimstudio    Jul 07, 2024   (16 reactions) A small image measurement tool to measure length and angle from image plans by clicking on certain points. There are several measurement tool softwares like ImageJ but are not suitable for my requirement very well. For my kite making it is important to have a fast pixel to certain unit mapping funct B4A Question fontsize multiple layout - Erel (first post)    May 28, 2015   (1 reaction) Canvas.MeasureStringHeight is based on a lower level API that doesn't behave in the same way that a Label or EditText will behave. StringUtils uses the same measurement process as the views. Share My Creation GeoMetrics : Land Measure App - Kasun Kanchana    Oct 30, 2023   (8 reactions) Hello everyone. This is a newly published Android app developed using B4A. It is a land measurement mobile app utilizing Google Maps and FusedLocationProvider. The app supports two types of measurement: Land Measure Path Measure (Distance) Users can employ three different measurement methods based B4A Question Measure text horizontally - adriano.freitas    Mar 03, 2022 I need a function that returns me, in dip or int, the horizontal measure of a text, that is, how much it would occupy horizontally on the screen. It will actually be placed on a label, but I don't care which object the measurement is based on. Does anyone have any suggestions? Ideally, it could be B4A Library MSDynamicGridView Library - JohnC (first post)    Aug 05, 2016   (1 reaction) View.measure(View.java:17623)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5548)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:436)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:135)
at android.view.View.measure(View. Page: 1   2   3   4   5   6   7   Powered by ColBERT |