comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » data coordinates thickness
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
data coordinates thickness [message #90275] Wed, 18 February 2015 07:46 Go to next message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
Hi,
I'm drawing objects (polygon(), ellipse(), polyline()) on an image. The image has a specific data coordinates.
I *assume* that the thickness of a line is defined in device coordinates. Is there a way to get the thickness of a line in data coordinates?
Of course an approximation would be enough.

One way, would be to use the ConvertCoord method as such:

zero = obj->ConvertCoord(0, 0, /data, /to_device)
one = obj->ConvertCoord(dataThickness, 0, /data, /to_device)
deviceThickness = one[0]-zero[0]

The assumption behind this is that the thickness is drawn in device coordinates. I guess this might be true for non zero values of the thickness (hairline) and maybe even for thicknesses of 1.

Can anybody confirm or correct the above statements?

Thanks,
Helder
Re: data coordinates thickness [message #90279 is a reply to message #90275] Wed, 18 February 2015 08:27 Go to previous messageGo to next message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Wednesday, February 18, 2015 at 4:46:20 PM UTC+1, Helder wrote:
> Hi,
> I'm drawing objects (polygon(), ellipse(), polyline()) on an image. The image has a specific data coordinates.
> I *assume* that the thickness of a line is defined in device coordinates. Is there a way to get the thickness of a line in data coordinates?
> Of course an approximation would be enough.
>
> One way, would be to use the ConvertCoord method as such:
>
> zero = obj->ConvertCoord(0, 0, /data, /to_device)
> one = obj->ConvertCoord(dataThickness, 0, /data, /to_device)
> deviceThickness = one[0]-zero[0]
>
> The assumption behind this is that the thickness is drawn in device coordinates. I guess this might be true for non zero values of the thickness (hairline) and maybe even for thicknesses of 1.
>
> Can anybody confirm or correct the above statements?
>
> Thanks,
> Helder

I just noticed that the maximum thickness is 10 (pixels?)... darn... I need something else and it's going to be difficult. Why limit to 10?

Cheers,
Helder
Re: data coordinates thickness [message #90285 is a reply to message #90279] Wed, 18 February 2015 10:15 Go to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Wednesday, February 18, 2015 at 9:27:48 AM UTC-7, Helder wrote:
> On Wednesday, February 18, 2015 at 4:46:20 PM UTC+1, Helder wrote:
>> Hi,
>> I'm drawing objects (polygon(), ellipse(), polyline()) on an image. The image has a specific data coordinates.
>> I *assume* that the thickness of a line is defined in device coordinates. Is there a way to get the thickness of a line in data coordinates?
>> Of course an approximation would be enough.
>>
>> One way, would be to use the ConvertCoord method as such:
>>
>> zero = obj->ConvertCoord(0, 0, /data, /to_device)
>> one = obj->ConvertCoord(dataThickness, 0, /data, /to_device)
>> deviceThickness = one[0]-zero[0]
>>
>> The assumption behind this is that the thickness is drawn in device coordinates. I guess this might be true for non zero values of the thickness (hairline) and maybe even for thicknesses of 1.
>>
>> Can anybody confirm or correct the above statements?
>>
>> Thanks,
>> Helder
>
> I just noticed that the maximum thickness is 10 (pixels?)... darn... I need something else and it's going to be difficult. Why limit to 10?
>
> Cheers,
> Helder

Hi Helder,
I'm not sure why the maximum is 10. Maybe because no one ever asked for more? Anyway, a better solution might be to use a polygon if you want to draw a really "thick" line. That way you have total control over the coordinates, and you can use things like ConvertCoord to calculate the thickness.
-Chris
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: clear the work bench
Next Topic: Re: Downgrade in support for non US users?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 07:14:20 PDT 2025

Total time taken to generate the page: 0.01063 seconds