adriano.freitas Active Member Feb 18, 2022 #1 I need a Sub that receives a text (generally long and that can have line breaks), font size and an indicative number of width and generates an image with the text. The final image needs to have the informed width, and the height should be dynamically adjusted to contain all text. I've seen several examples here about converting text to image but none that I could adapt that way. Can anyone help? Thanks!
I need a Sub that receives a text (generally long and that can have line breaks), font size and an indicative number of width and generates an image with the text. The final image needs to have the informed width, and the height should be dynamically adjusted to contain all text. I've seen several examples here about converting text to image but none that I could adapt that way. Can anyone help? Thanks!
asales Expert Licensed User Longtime User Feb 19, 2022 #2 I think you can use this approach: - use scrollview in a panel to load a layout with the label - get the height of the text with StringUtils.MeasureMultilineTextHeight - adjust the scrollview/panel accordly the text height - get a snapshot of the panel and save it into an image Upvote 0
I think you can use this approach: - use scrollview in a panel to load a layout with the label - get the height of the text with StringUtils.MeasureMultilineTextHeight - adjust the scrollview/panel accordly the text height - get a snapshot of the panel and save it into an image
TILogistic Expert Licensed User Longtime User Feb 19, 2022 #3 review, it can give you an idea: Drawing to a view Hi, me again... I try to draw a bitmap to a TextField with the code below, but it does nothing :( What am I doing wrong ? Dim cvs As Canvas cvs.Initialize(EtSignature) Dim right, bottom As Int Dim right As Int = EtSignature.Left... www.b4x.com Upvote 0
review, it can give you an idea: Drawing to a view Hi, me again... I try to draw a bitmap to a TextField with the code below, but it does nothing :( What am I doing wrong ? Dim cvs As Canvas cvs.Initialize(EtSignature) Dim right, bottom As Int Dim right As Int = EtSignature.Left... www.b4x.com