gxpark
Apr 26th, 2001, 02:00 PM
Hello,
I'm having big trouble with my lil' app.
One of it's modules reads formulas and plotting instructions from a XML file, and then plots the instructions on a PictureBox, and shows the result of the formulas.
The problem is that I can't plot proportionally. Let me put an example.
I have a PB measuring 561x290, and the instructions are to draw a trapezoid, measuring 100x40x70 (B, b, h).
So, I set the scaling properties of the PB to the following:
PB.ScaleWidth = (PB.Width / PB.Height) * h
PB.ScaleHeight = h
This does work, it draws the trapezoid ok, and proportionally. But if I change the measures to 100x40x10, the figure spans off the PB, because ScaleWidth=17.79, and since B=100...
The problem of course, is not with the plotting instructions, because if instead of rescaling the PB, I resize it to match the limits of the figure, the figure looks ok.
I've tested many options and variants, and I'm going nuts now...
Anyone can help me?
:confused: :confused: :confused:
I'm having big trouble with my lil' app.
One of it's modules reads formulas and plotting instructions from a XML file, and then plots the instructions on a PictureBox, and shows the result of the formulas.
The problem is that I can't plot proportionally. Let me put an example.
I have a PB measuring 561x290, and the instructions are to draw a trapezoid, measuring 100x40x70 (B, b, h).
So, I set the scaling properties of the PB to the following:
PB.ScaleWidth = (PB.Width / PB.Height) * h
PB.ScaleHeight = h
This does work, it draws the trapezoid ok, and proportionally. But if I change the measures to 100x40x10, the figure spans off the PB, because ScaleWidth=17.79, and since B=100...
The problem of course, is not with the plotting instructions, because if instead of rescaling the PB, I resize it to match the limits of the figure, the figure looks ok.
I've tested many options and variants, and I'm going nuts now...
Anyone can help me?
:confused: :confused: :confused: