opus Active Member Licensed User Longtime User Oct 8, 2015 #1 Hi, I use the AndroidResources Library to supply the app with different resources. I'm using the following to asign a bitmap-variable with a graphic resource Code: Dim mBitmap as Bitmap Dim BitmapDrawable1 As BitmapDrawable BitmapDrawable1=Main.MyResources.GetApplicationDrawable("DrawableResource") mBitmap=LoadBitmap(File.DirAssets,"DrawableResource.gif") mBitmap=BitmapDrawable1.Bitmap I can't find solution to assign "mBitmap" with the Resource-Bitmap without initially assigning it a Bitmap from a different file. Is there a better solution?
Hi, I use the AndroidResources Library to supply the app with different resources. I'm using the following to asign a bitmap-variable with a graphic resource Code: Dim mBitmap as Bitmap Dim BitmapDrawable1 As BitmapDrawable BitmapDrawable1=Main.MyResources.GetApplicationDrawable("DrawableResource") mBitmap=LoadBitmap(File.DirAssets,"DrawableResource.gif") mBitmap=BitmapDrawable1.Bitmap I can't find solution to assign "mBitmap" with the Resource-Bitmap without initially assigning it a Bitmap from a different file. Is there a better solution?
Erel B4X founder Staff member Licensed User Longtime User Oct 9, 2015 #2 This line is unnecessary: mBitmap=LoadBitmap(File.DirAssets,"DrawableResource.gif") It will work without it. Upvote 0
This line is unnecessary: mBitmap=LoadBitmap(File.DirAssets,"DrawableResource.gif") It will work without it.
opus Active Member Licensed User Longtime User Oct 9, 2015 #3 Thanks for the reply, however without this line I get an error message stating the object (the Bitmap-var??) has to be initialized. The whole code is within an Initialize Routine for a custom object, "mBitmap" being one of the objects properties. EDIT: Me stupid, it works without this line. Thanks Erel, I was trying it that way (I was thinking) for the last two days, it didn't work. Conclusion: Me.Stupid! Last edited: Oct 9, 2015 Upvote 0
Thanks for the reply, however without this line I get an error message stating the object (the Bitmap-var??) has to be initialized. The whole code is within an Initialize Routine for a custom object, "mBitmap" being one of the objects properties. EDIT: Me stupid, it works without this line. Thanks Erel, I was trying it that way (I was thinking) for the last two days, it didn't work. Conclusion: Me.Stupid!