Qt-embedded-interest Archive, December 2006
drawing lines between float points
Message 1 in thread
Hi All,
Is there any wat to draw lines between float points.
for example if I have points like
( 42.0 ,1.25 ) , (53.50, 2.07)
In Qpainter i saw but all the drawline and LineTo functions are taking
integer values as arguments.
If any body has some ideas kindly suggest me.
Thanks in advance,
Regards,
Harsha
To unsubscribe - send "unsubscribe" in the subject to qt-embedded-interest-request@xxxxxxxxxxxxx
Message 2 in thread
harshavardhanreddy mandeepala wrote:
> Hi All,
> Is there any wat to draw lines between float points.
> for example if I have points like
> ( 42.0 ,1.25 ) , (53.50, 2.07)
>
> In Qpainter i saw but all the drawline and LineTo functions are taking
> integer values as arguments.
Maybe because these are pixel coordinates?
You have to map your points to pixel coordinates.
What are you trying to do? If you want to draw diagrams or plots then
google for qwt.
Best,
Andre
To unsubscribe - send "unsubscribe" in the subject to qt-embedded-interest-request@xxxxxxxxxxxxx
Message 3 in thread
On 12/19/06, Andre Haupt <haupt.andre@xxxxxx> wrote:
> harshavardhanreddy mandeepala wrote:
> > Hi All,
> > Is there any wat to draw lines between float points.
> > for example if I have points like
> > ( 42.0 ,1.25 ) , (53.50, 2.07)
> >
> > In Qpainter i saw but all the drawline and LineTo functions are taking
> > integer values as arguments.
> Maybe because these are pixel coordinates?
> You have to map your points to pixel coordinates.
>
> What are you trying to do? If you want to draw diagrams or plots then
> google for qwt.
>
> Best,
>
> Andre
>
Hi Andre,
Thanks for your help.
Can you explain little more.?
I just wanted to draw lines based on my input.
The input is in the float values Up to two decimal points.
How can i map these points to pixel values?These are not pixel values
but actual input.
Thanks once again,
Regards,
Harsha
To unsubscribe - send "unsubscribe" in the subject to qt-embedded-interest-request@xxxxxxxxxxxxx
Message 4 in thread
> I just wanted to draw lines based on my input.
>
> The input is in the float values Up to two decimal points.
>
> How can i map these points to pixel values?These are not
> pixel values but actual input.
>
> Thanks once again,
You have to choose what you want your x and y ranges to be and then
convert. Something like:
plotX = (realX - minRealX) / (maxRealX - minRealX) * (maxPlotX -
minPlotX) + minPlotX
Same for y
This is pretty basic stuff,
Ben
>
>
> Regards,
> Harsha
>
> To unsubscribe - send "unsubscribe" in the subject to
> qt-embedded-interest-request@xxxxxxxxxxxxx
>
>
To unsubscribe - send "unsubscribe" in the subject to qt-embedded-interest-request@xxxxxxxxxxxxx