iOS Question Drawing to a view

MitchBu

Well-Known Member
Licensed User
Longtime User
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.
 

sorex

Expert
Licensed User
Longtime User
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

MitchBu

Well-Known Member
Licensed User
Longtime User
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
    472 KB · Views: 205
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
see use B4XCanvas in B4X:

 
Upvote 0
Top