MitchBu Well-Known Member Licensed User Longtime User Jan 6, 2021 #1 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 ? B4X: Dim cvs As Canvas cvs.Initialize(EtSignature) Dim right, bottom As Int Dim right As Int = EtSignature.Left + EtSignature.Width Dim bottom As Int = EtSignature.Top + EtSignature.height Dim DestRect As Rect DestRect.Initialize(EtSignature.Left, EtSignature.Top, right, bottom) cvs.DrawBitmap(Image, DestRect) 'draws the bitmap to the destination rectangle. Image is a valid bitmap that displays just fine in an imageview.
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 ? B4X: Dim cvs As Canvas cvs.Initialize(EtSignature) Dim right, bottom As Int Dim right As Int = EtSignature.Left + EtSignature.Width Dim bottom As Int = EtSignature.Top + EtSignature.height Dim DestRect As Rect DestRect.Initialize(EtSignature.Left, EtSignature.Top, right, bottom) cvs.DrawBitmap(Image, DestRect) 'draws the bitmap to the destination rectangle. Image is a valid bitmap that displays just fine in an imageview.
S sorex Expert Licensed User Longtime User Jan 6, 2021 #2 are you sure you aren't drawing outside the visible area? left/down should be 0 I guess unless you over/underlay it instead of attaching it to the textfield. and right=EtSignature.Width bottom=EtSignature.height Upvote 0
are you sure you aren't drawing outside the visible area? left/down should be 0 I guess unless you over/underlay it instead of attaching it to the textfield. and right=EtSignature.Width bottom=EtSignature.height
Erel B4X founder Staff member Licensed User Longtime User Jan 7, 2021 #3 1. Better to use B4XCanvas. 2. Don't forget to call B4XCanvas.Invalidate. Tip: reuse the canvas when possible. Upvote 0
1. Better to use B4XCanvas. 2. Don't forget to call B4XCanvas.Invalidate. Tip: reuse the canvas when possible.
MitchBu Well-Known Member Licensed User Longtime User Jan 7, 2021 #4 Erel said: 1. Better to use B4XCanvas. 2. Don't forget to call B4XCanvas.Invalidate. Tip: reuse the canvas when possible. Click to expand... Which library is B4XCanvas in ? Thank you. Upvote 0
Erel said: 1. Better to use B4XCanvas. 2. Don't forget to call B4XCanvas.Invalidate. Tip: reuse the canvas when possible. Click to expand... Which library is B4XCanvas in ? Thank you.
LucaMs Expert Licensed User Longtime User Jan 7, 2021 #5 MitchBu said: Which library is B4XCanvas in ? Click to expand... https://www.b4x.com/android/forum/pages/results/?query=B4XCanvas Upvote 0
MitchBu said: Which library is B4XCanvas in ? Click to expand... https://www.b4x.com/android/forum/pages/results/?query=B4XCanvas
MitchBu Well-Known Member Licensed User Longtime User Jan 7, 2021 #7 Erel said: XUI Click to expand... Thank you Erel Upvote 0
MitchBu Well-Known Member Licensed User Longtime User Jan 8, 2021 #8 OK. I tried B4XCanvas, but no joy. I see nothing Here is the code (project attached): B4X: Canvas1.Initialize(Panel1) Dim Rect1 As B4XRect Rect1.Initialize(100dip, 100dip, 200dip, 150dip) Canvas1.DrawRect(Rect1, Colors.Black, True, 5dip) Canvas1.DrawText("Testing", 100dip, 100dip, Font.DEFAULT, Colors.Red,"LEFT") What am I doing wrong ? I will appreciate any pointers. TIA Attachments com.matchsoftware.b4xCanvas.zip com.matchsoftware.b4xCanvas.zip 472 KB · Views: 454 Upvote 0
OK. I tried B4XCanvas, but no joy. I see nothing Here is the code (project attached): B4X: Canvas1.Initialize(Panel1) Dim Rect1 As B4XRect Rect1.Initialize(100dip, 100dip, 200dip, 150dip) Canvas1.DrawRect(Rect1, Colors.Black, True, 5dip) Canvas1.DrawText("Testing", 100dip, 100dip, Font.DEFAULT, Colors.Red,"LEFT") What am I doing wrong ? I will appreciate any pointers. TIA
MitchBu Well-Known Member Licensed User Longtime User Jan 9, 2021 #9 I forgot to call invalidate! I should have re read Erel's post. Thank you Upvote 0
TILogistic Expert Licensed User Longtime User Jan 9, 2021 #10 see use B4XCanvas in B4X: SuperToolTips Hello, Could you tell me which way to use that kind of toolTips : seen on: https://stackoverflow.com/questions/21031488/android-popupwindow-with-tooltip-arrow Regards Michel www.b4x.com Upvote 0
see use B4XCanvas in B4X: SuperToolTips Hello, Could you tell me which way to use that kind of toolTips : seen on: https://stackoverflow.com/questions/21031488/android-popupwindow-with-tooltip-arrow Regards Michel www.b4x.com
TILogistic Expert Licensed User Longtime User Jan 9, 2021 #11 demo B4J: also works on b4a and b4i to see what to do with B4Xcanvas. Attachments B4XBubble.zip B4XBubble.zip 4 KB · Views: 512 Upvote 0
MitchBu Well-Known Member Licensed User Longtime User Jan 9, 2021 #12 oparra said: demo B4J: also works on b4a and b4i to see what to do with B4Xcanvas. Click to expand... Superb. Thank you oparra Upvote 0
oparra said: demo B4J: also works on b4a and b4i to see what to do with B4Xcanvas. Click to expand... Superb. Thank you oparra