I was writing an iOS app that uses a canvas and in the Paint event i need to draw some texts and shapes. I need them white, so I set the g.FillColor and the g.LineColor to be white, but when I run the app the shapes and the texts are transparent. I tried to set them black and they (texts and shapes) don’t disappear. How do I fix that?
[Edited in order to make the post more understandable]
You should be using g.ForeColor prior to the calls to g.DrawLine or g.FillRect.
g.FillColor is a read-only value and returns the background colour of the window.
Sorry, I forgot to say that I’m using iOS, so there isn’t a ForeColor property, but instead there are FillColor and LineColor
Sorry, my bad. I didn’t see that this is in the iOS thread!
How are you setting the FillColor and LineColor to white? I do this:
g.LineColor = color.rgb(255, 255, 255)
g.FillColor = color.rgb(255, 255, 255)
Thank you Jason, now it works.
I set white color like this:
g.LineColor = &cFFFFFF
g.FillColor = &cFFFFFF
What’s bad in this code?
Hmmm. Not sure. That looks as though it should work. I use several constants representing color values that way.
Transparency? (Guessing here)