i am writing an application using .net ide which will animate a processor. Im new to C# language. Im sure this has been done before however after searching briefly on the net for help i cant find anything specific to my needs.
Which is to have various different lines (width 10 pixels) on a form, at certain times i want to show a small block ( different colour, representing data) move along a certain line (bus). A lecturer at uni has suggested i do something like this
Code:
private int busLength = 25;
private int[] busPath = {x,y,x,y,x,......};/*the x,y points of a certain bus*/
private int dataPos; //position of data on bus
private int oldDataPos;//previous position of data
private int busWidth;
Paint()
{
for(int 1=0;i<busLength;i++)
{
color.grey
if(i==dataPos)
color.red
object.FillRectangle(anotherobject, busPath[i*2]-5,busPath[(i*2)+1]-5, color);
}
i tried playing around with using the array index as an arg in the FillRectangle method with no success (Array out of bounds exception)
can some help me get off the ground or point me in the right direction please