incendio Well-Known Member Licensed User Longtime User May 23, 2014 #1 Hi guys, I am trying to set background image for panel/imageview with SetBackgroundImage method. It was failed when using image file (jpg file) with size about 2.5MB. Is there any size limitation? If there is a limit, what is the max size limit to works correctly? Thanks in advance.
Hi guys, I am trying to set background image for panel/imageview with SetBackgroundImage method. It was failed when using image file (jpg file) with size about 2.5MB. Is there any size limitation? If there is a limit, what is the max size limit to works correctly? Thanks in advance.
LucaMs Expert Licensed User Longtime User May 23, 2014 #2 I have loaded a picture of 2.87 Mb in this way without any problems. Code: Copy Private bmp As Bitmap bmp.Initialize(File.DirAssets, "TestFile.jpg") Private bmd As BitmapDrawable bmd.Initialize(bmp) Panel1.Background = bmd However, remember that you can use LoadBitmapSample Upvote 0
I have loaded a picture of 2.87 Mb in this way without any problems. Code: Copy Private bmp As Bitmap bmp.Initialize(File.DirAssets, "TestFile.jpg") Private bmd As BitmapDrawable bmd.Initialize(bmp) Panel1.Background = bmd However, remember that you can use LoadBitmapSample
Erel B4X founder Staff member Licensed User Longtime User May 23, 2014 #3 The only limit is the process available memory. Remember that the file size doesn't really matter. What matters if the actual image size as images are stored uncompressed in memories. The bottom line is that you should LoadBitmapSample. Upvote 0
The only limit is the process available memory. Remember that the file size doesn't really matter. What matters if the actual image size as images are stored uncompressed in memories. The bottom line is that you should LoadBitmapSample.
incendio Well-Known Member Licensed User Longtime User May 23, 2014 #4 Thanks for your help guys. Changing from LoadBitmap to LoadBitmapSample, works ok. Upvote 0