Hi,
I have my own little ILookUpObjectList (see below).
The colors I set there are plain colors, green, orange, red etc...
On the display however the colors are changed to more lighter colors. That's not the problem, as the colors are nice.
BUT: now I tried to add a legend, that tells what color is linked to what schedule status. But since I colors displayed are not the ones set I can't show exactly the color in my legend!
Can you tell me the exact colors that come out when I use my ILookUpObjectList?
(I use the same lookup list as Markers and Labels)
Thank you very much.
Samy Abou-Shama
---------------------------------------------
code:
internal class MyLookUpList : ILookUpObjectList
{
private Dictionary list;
public MyLookUpList()
{
list = new Dictionary();
list.Add(0, new ListObject(0, "Planned", Color.Orange));
list.Add(1, new ListObject(1, "Scheduled", Color.Green));
list.Add(2, new ListObject(2, "Deffered", Color.LightGreen));
list.Add(3, new ListObject(3, "Completed", Color.Blue));
list.Add(4, new ListObject(4, "Cancelled", Color.Black));
}
public ILookUpObject this[int i]
{
get
{
ILookUpObject result = null;
if (list.ContainsKey( i ))
{
result = list[i];
}
return result;
}
set { throw new NotImplementedException(); }
}
}
AD
Administrator
Syncfusion Team
October 17, 2007 03:05 PM UTC
The ScheduleControl uses alphablending to lighten the colors that are specified in the Labels. For example, here is the code that retrieves the label color and transforms it to the color the schedule uses by setting the alpha property to 100.
Color c = Color.FromArgb(100, ((ListObject)this.dataProvider.GetLabels()[item.LabelValue]).ColorMember);
So, you could use similar code to get the same color as the ScheduleControl uses.