Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm designing a silverlight application for showing sheet music from a midi file.

I want to create a horizontally scrolling musical staff.

At my job I maintain a winforms application that is a scrolling Gantt chart of airplane schedules, and it basically has a rows collection, and it maps the left-most pixel and right-most pixels of the control to datetimes. Then the paint method loops through what it determines will be the visible rows, and draws a screen that shows the schedule information between the two dates.

Would I be correct in assuming that I would need to something similar in silverlight for my sheetmusic, or would it be better to just create a horizontal scrollviewer containing a canvas that I have drawn programmaticially on.

Am I headed in the right direction? I havent seen any articles on designing such a custom control: can you point me at any?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

It think your second idea - that of a horizontal scroll viewer is the "better" one.

With Silverlight, unless you get into the really low level drawing of 3D elements, you don't need (or indeed have) the same concept as a "paint" method.

It might even be worth looking at a horizontal StackPanel with a background image of the staves. Then each element in the panel could be a note (or a collection of notes) that would draw themselves.

share|improve this answer
    
Thanks for the advice, Chris! –  Rick Hodder Nov 6 '12 at 15:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.