This demo project shows how the polyline API function works and how much faster it can be than the Line method.
It plots on a picturebox a random number of rectangles and rhombi (with random colours) either by the Line method or the polyline function. The maximum number is input by the user in 2 textboxes. A value of 10 is initially assigned to more clearly show what the code does, but if maximum numbers are specified in the order of several thousands, then the time differences are more obvious between both 2 methods, though the picturebox becomes so cluttered with points that the individual shapes are no longer distinguishable.
The drawing mode has been set to vbNotXorPen so that the contours can be turned on and off. The reason for turning them off this way -rather than simply clearing the picturebox- is at times you may have a lot more stuff in there that should not be deleted and otherwise would have to be recreated.