I think this is my first ever question and I have been using B4A for many years now, it is awesome.
I have an app where the user is presented with an invoice (jpg) to sign. I have a canvas attached to a panel, and the user draws (signs) on it.
They have now got a new phone with a much higher pixel density, so to keep the same physical size I have to make a bigger destination rectangle because the panel is bigger. The trouble is that canvas.initialize causes out of memory ( and I have a large heap etc)
so the question is , is there anyway to say that the canvas is to be scaled up by say 50%, but not take any more memory.
This works on my samsung note 8
Sub btn_Click
Dim bmp As Bitmap
bmp=LoadBitmap(File.DirAssets,"invoice.jpg")
Dim cvs As Canvas
Dim destRect As Rect
destRect.Initialize(0,0,pnl.Width,pnl.Height)
cvs.Initialize(pnl)
cvs.DrawBitmap(bmp,Null,destRect)
End Sub
but not on my samsung note 4 because it has such a high pixel density that the panel width and height are much bigger.
the crash happens on cvs.initialize(pnl)
Note the panel is bigger than the screen, and I'm using the draggable view so the user can drag the panel around to see the whole invoice.
I have an app where the user is presented with an invoice (jpg) to sign. I have a canvas attached to a panel, and the user draws (signs) on it.
They have now got a new phone with a much higher pixel density, so to keep the same physical size I have to make a bigger destination rectangle because the panel is bigger. The trouble is that canvas.initialize causes out of memory ( and I have a large heap etc)
so the question is , is there anyway to say that the canvas is to be scaled up by say 50%, but not take any more memory.
This works on my samsung note 8
Sub btn_Click
Dim bmp As Bitmap
bmp=LoadBitmap(File.DirAssets,"invoice.jpg")
Dim cvs As Canvas
Dim destRect As Rect
destRect.Initialize(0,0,pnl.Width,pnl.Height)
cvs.Initialize(pnl)
cvs.DrawBitmap(bmp,Null,destRect)
End Sub
but not on my samsung note 4 because it has such a high pixel density that the panel width and height are much bigger.
the crash happens on cvs.initialize(pnl)
Note the panel is bigger than the screen, and I'm using the draggable view so the user can drag the panel around to see the whole invoice.