Android Question Canvas.DrawText in a class

scrat

Active Member
Licensed User
Longtime User
Hi!

I am using this code in a class
B4X:
Dim Bmp As Bitmap
Bmp.InitializeMutable(Wbmp,Hbmp)
Dim C As Canvas
C.Initialize2(Bmp)
C.DrawText(Str,x,y,Typeface.SANS_SERIF,25dip,Colors.Blue,"CENTER")

and i get this error

I know I can use a DummyView but the bitmap is stored in a processglobal map.

Why drawtext use an activity context ?

Thanks
 

scrat

Active Member
Licensed User
Longtime User
Thanks Erel.

Unfortunately the class has a process global instance.
I use drawtext from ABextdraw and i don't have this behavior.

Other B4a drawing functions (drawcircle,drawline etc..) operate without this error.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…