how to scale plotting in a picturebox?

realolman

Member
Joined
Jan 2, 2017
Messages
7
Programming Experience
10+
I am plotting temperatures in a picturebox and the values I use probably won't change more than about from 65 to 75, but I would like to make the changes more apparent in the graph.

In the old VB6 there was a way to scale the picturebox. I have looked it up, but have not found anything I understand with VB.net.... I don't get the pointF stuff at all.

My picturebox size is 1440 wide and 500 high... how could I scale the picturebox so that the values I plot are near the bottom at 60 and near the top at 80? I don't want to change the horizontal values

I would at least like the picurebox chart to display from low values at the bottom to high values at the top.

Is there something I can do with the picturebox, or do I need to do something in code with the values to make them fit the picturebox?

Having written that, it seems that I should do something in the code.

Please advise

thank you
 
Last edited:
It sounds like simple math to me, 500px high for range 60-80 is 25px per value - so value 60 is at 500px, value 61 is at 500-25=475px etc.

Also, wouldn't using Chart component be a lot easier for this?
 
It sounds like simple math to me, 500px high for range 60-80 is 25px per value - so value 60 is at 500px, value 61 is at 500-25=475px etc.

Also, wouldn't using Chart component be a lot easier for this?

Could certainly be... I am, as my name says, a realolman, having started in GWBASIC. I don't know what the chart component is.... I will look it up

I believe that at some point in the BASIC evolution, I could have set a "scale" for the picturebox to be 80 at the top and 60 at the bottom, but I guess that was at some point... this is this point.

I will look into the Chart component... if it's anything similar to excel, it will probably be dandy. I should have guessed there was something.

And it seems you are correct with your math as well... I had a bunch of other conversions to do to get to the point I was at, and I guess I got confused by the time I got here... and I was kinda hung up on the "scale" thing

at any rate ....

thank you very much
 
Back
Top