Re: Loss of precision when drawing gridlines and blocks on top.....
- From: alexstevens@xxxxxxxxxxxxxxxx
- Date: Mon, 3 Mar 2008 11:03:15 -0800 (PST)
Thanks for the responses Michael and Bob - I'm very grateful.
What I've ended up doing is having a property which allows you to
define the width of a column (represents one hour - I'm building a
timeline control for multiple elements down the left). I then
calculate the amount of pixels as a float which represent a second in
time (columnwidth / 3600) and then multiply that up by the amount of
time I'm trying to display. I do the same to plot the gridlines which
define the columns, and round using a generic function which
theoretically should give me the same result for two different
calculations with the same parameters. You're right though, to try to
split up 50-100 pixels into 24 equal segments for display is
ridiculous - hence my new approach of allowing the user to define the
column width.
This leads me onto my next problem. I need to implement scrolling in
my control, but I'm struggling to find resource to help me with it.
There are a couple of alternatives:
1. Create a composite control and have scrollbars.
2. Inherit from Scrollable control and let the framework draw the
scroll bars (i've not been able to get this to work in the slightest!!
I'm trying to follow this but it doesn't display scrollbars when I
paint outside of the bounds of the controls ClientRect:
http://www.dotnet247.com/247reference/msgs/53/267790.aspx - This is my
preference.
3. Draw my own scrollbars - this isn't my preference.
Could anyone give me a good place to start. I'm drawing my control
bigger than the client area - I just need to display scrollbars to
allow the user to scroll to non-visible areas.
Thanks guys.
.
- Prev by Date: Re: Graphics.TextRenderingHint throw exception?
- Next by Date: Re: Graphics.TextRenderingHint throw exception?
- Previous by thread: Re: Graphics.TextRenderingHint throw exception?
- Next by thread: Re: String drawing gives me headache... advise very welcome
- Index(es):
Relevant Pages
|