>>> Is it somehow possible to call Graphics.DrawLine with List<Point>?
>>> Does it only take Point arrays? If so, how can I (easily) convert my
[quoted text clipped - 3 lines]
>
> Hah! I'm new to generic lists so didn't expect it to be so easy. Thanks!
You're welcome.
That said, if you are surprised that they haven't added a DrawLines()
overload that takes an IList<Point>, or IEnumerable<Point> or something
like that, I wouldn't blame you. :) Seems like a silly oversight to me.
You _should_ be able to just pass a List<> instance to some version of
DrawLines(), rather than having to convert to an array.
Pete
Ignacio Machin ( .NET/ C# MVP ) - 15 Feb 2008 12:56 GMT
Hi,
>>>> Is it somehow possible to call Graphics.DrawLine with List<Point>?
>>>> Does it only take Point arrays? If so, how can I (easily) convert my
[quoted text clipped - 11 lines]
> You _should_ be able to just pass a List<> instance to some version of
> DrawLines(), rather than having to convert to an array.
I do not think this will every happen :(.
Cause how many methods there are in the framework that expect an Array , all
of those methods would be candidates to get a overload with List<T> , as
long as you can convert a List<> to Array it's good enough.
Peter Duniho - 15 Feb 2008 23:35 GMT
>> That said, if you are surprised that they haven't added a DrawLines()
>> overload that takes an IList<Point>, or IEnumerable<Point> or something
[quoted text clipped - 6 lines]
> all of those methods would be candidates to get a overload with List<T>
> , as long as you can convert a List<> to Array it's good enough.
Well, except for the fact that it could in fact be a performance burden.
You may be right that it's too sweeping a change for Microsoft to feel
it's worth doing. But they _do_ have a variety of other things that they
do that require sweeping changes. If anything, that's one of the things a
company with their resources can be very good at. :)
Pete