Hi all,
Can someone tell me which is the best way to load image regarding memory consumption:
1. Load directly to view variable like sample code bellow
--- or ---
2. Load to Bitmap object first then assign it to the view
Or maybe both use the same amount of memory.
Sorry if this is a stupid question
. Thanks.
Can someone tell me which is the best way to load image regarding memory consumption:
1. Load directly to view variable like sample code bellow
B4X:
ImageView1.Bitmap=LoadBitmapSample(File.DirAssets,"image.png",ImageView1.Width,ImageView1.Height)
Button1.SetBackgroundImage(LoadBitmapSample(File.DirAssets,"image.png",Button1.Width,Button1.Height))
--- or ---
2. Load to Bitmap object first then assign it to the view
B4X:
Dim loadbmp as Bitmap
loadbmp.InitializeSample(File.DirAssets,"image.png",loadbmp.Width,loadbmp.height)
ImageView1.Bitmap=loadbmp
Button1.SetBackgroundImage(loadbmp)
Or maybe both use the same amount of memory.
Sorry if this is a stupid question
Last edited: