I'm trying to draw a vertical scrollbar for my G15 applet, but am having difficulty positioning it properly (if you haven't done anything for the G15 LCD screen, think of it as drawing on a 160x43 pixel image).
This is my current code for positioning:
perc = (float)Math.Round( range / Items.Count+1 );
y = ( perc * SelectedID+1 );
The upper edge of the scrollbar is at 5px from the top, the bottom edge is at 32px. Y in this case would be the upper end of the scrollbar, and I'm using a length of 2 pixels; I did try to impliment a variable length bar, it went about as well as the code above. SelectionID is 0 based.
All I need is the math to figure out the position, no need for code for drawing it.
Thanks.