I am probably doing something silly here but should the following code work? Depending on the bitmap's dimensions the loop crashes after a consistent number of iterations. The larger the dimensions, the fewer the iterations before it crashes. (With 1280x720 it crashes after 394 iterations on an iPhone SE.) I assume there is some memory issue at play. Nothing is written to the log when it crashes, the app simply closes. I have never seen it crash on the simulator but that's perhaps due to the amount of memory available?
I have included a couple of comments in the code just to show that the real code is doing something more interesting than writing a black bitmap on top of another 1000 times!
I have included a couple of comments in the code just to show that the real code is doing something more interesting than writing a black bitmap on top of another 1000 times!
B4X:
bc1.Initialize(1280,720)
bc1.DrawRect(bc1.TargetRect,Colors.Black,True,1)
Dim bmp As B4XBitmap=bc1.Bitmap
bc2.Initialize(1280,720)
For i=1 To 1000
'generate a new bmp
bc2.DrawBitmap(bmp, bc2.TargetRect, True)
'write bc2.bitmap
Log(i)
Next