Hi there,
for some CustomDrawing operations I need to know the exact visible Start and End DateTime of an item being drawn in the resourceview. In case the item is drawn completely these DateTimes should exactly match the Start and End time of the item given in args.Item. But I can't achieve this...
My test was as follows: I created an Item starting at 09:12:05. In the ItemDrawing event I called GetExactDateAt(args.Bounds.X, 10) assuming this should be the same as the start time (as long as the item is completely visible on the chart). But the result was 09:07:05. Then I thought, maybe it's an issue regarding the coordinate system of GDI+ but it isn't.
var s1 = _ganttChart.GetExactDateAt(args.Bounds.X - 1, 10);
var s2 = _ganttChart.GetExactDateAt(args.Bounds.X + 1, 10);
s1 is 09:04:51 for the item
s2 is 09:10:45 for the item
I thought at least one of the calls to GetExactDateAt() should return a value equal or greater than 09:12:05 (the items start time).
Is this a bug or am I using the wrong method? For precise painting on the time line I need a way to precisely map between the drawn coordinates and the time values. Thanks in advance for any help on this topic.
Best regards
Achim