TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Administrator
Tech Writer
2.2k
1.5m
Drawing and scaling
Apr 2 2003 9:21 AM
Daniel Stefanescu posted an article and code that demonstrates drawing a line chart. I understand most of what is going on. I am stumped by the scaling code. Here is that snippet. XScale = (myRect.Width / (this.chartData.XValues.Length - 1)); a = (myRect.Height / (YMax - YMin)); b = -YMin * a; YScale = (myRect.Height / YMax); for (i = 0; i < this.chartData.XValues.Length; i++) { myX = XScale * i; myY = myRect.Height - (a * line.Values[i] + b); LinePoints[i] = new PointF(myX, myY); } myGraphics.DrawLines(LinePen, LinePoints); The entire article is titled "A Variety of Chart Engines". I changed two of the object names to make them more meaningful to me and removed some spaces. Other than that, the code is the same as in the article. Could someone explain the point of this code? How does this create the image to the appropriate size? I am guessing that's what it does.
Reply
Answers (
1
)
how can a background directsound program play sound
Image on TabPage