0

Anyone have any ideas... I need to impose an external vertical display scale on an oxyplot being shown in a Panel. For example, if the oxyplot vertical scale shows 2000 to 10000, I would like to size the Panel height so that in effect the oxyplot is sized in the Panel at, say, 200 per vertical inch of display. Obviously the Panel will be scrolled to include the entire plot when done.

See any way to calculate this Panel height to make this happen?

Object of this exercise is to be able to extract the Panel contents as an image, and then align the image with other images already at the same external scaling.

Thanks.

  • Didn't worked with oxyplot, but what is the problem? What you can't do? Can't you get vertical scale? Can't you resize Panel? Don't you know formula? Or which event to use? The last paragraph implies it's an attempted solution, would you rather want to solve the original problem (see [xy problem](https://meta.stackexchange.com/q/66377/299295))? – Sinatr Jun 22 '21 at 13:56

1 Answers1

0

So you need the number of pixels corresponding to 40 inches (40 * 200 = 8000). In WPF you would just need to multiply this by 96, as WPF units are "device independent units". Since you're in Winforms, you'll need to get the actual dots per inch that the monitor is set to. There are lots of examples on SO, for example, https://stackoverflow.com/a/6844216/1594263.

Be sure and test with your monitor set at normal scaling (100% - i.e. 96 pixels per inch) and then again after scaling it to something else (e.g., 125% or 150%).

You mention setting the Panel height, when I do this, I set the PlotView height (that's a WPF class I think, so may be different in your case).

Jim Foye
  • 1,918
  • 1
  • 13
  • 15