How do I change a bitmap's color that I call/display from layout?
i am trying to change the color of a bitmap during runtime that I load from layout.xml. The bitmap itself is black, however when I add:
How do I change a bitmap's color that I call/display from layout?
i am trying to change the color of a bitmap during runtime that I load from layout.xml. The bitmap itself is black, however when I add:
Simple answer is that you can't do what you want. You can have bitmaps that are the same but different cools and load the one you want.
You can also create a custom font of your icons, and the use dc,setColor() when you display that "font",
Thanks for responding. So...follow up question. If I change my Bitmap to a drawable list, I should be able to change the color in runtime, correct?
I found an old post (https://forums.garmin.com/developer/connect-iq/f/discussion/2631/changing-parameters-of-shapes-defined-in-xml) where Travis recommended assigning color a variable in the layout.xml, then assigning the variable during the program. However, I could not get it to take a variable. The compiler requires the number or Graphics.COLOR_*** or it crashes.
According to Core Topics, the <shape> tag, color attribute defaults to the foreground color if left unfilled. Great! I set up a myfeet.draw(dc) to only find the objects will not draw unless I hard code a color in the layout.xml. Thoughts?
file *view.mc:
var myFeet;
in function initialize()...
myFeet = new Rez.Drawables.feet();
in function onUpdate()...
It's possible now with newer devices, drawBitmap2 and the tintcolor option.