Android Question Canvas in code module?

boten

Active Member
Licensed User
Longtime User
Although a Canvas is an "Activity Object", can a canvas be used in a code module?

A sub in a code module is passed a bitmap and returns a bitmap (manipulated with canvas).

for example:
B4X:
sub DoIt(pic as bitmap) as bitmap
dim cvs as canvas
dim bmp as bitmap
Dim rct As Rect
bmp.InitializeMutable(....
rct.Initialize(.......
cvs.Initialize2(bmp)
cvs.DrawBitmap(.......
return bmp
end sub
 

stevel05

Expert
Licensed User
Longtime User
It should work, have you tried it?
 
Upvote 0
Top