Board index » delphi » Vector graphics in scale?

Vector graphics in scale?

Hello World!

Is there anyone out there who has an idea of how to do this:

I want to draw a line on the screen (might be different resolutions or
screen sizes), and I always want it to be as close to "natural" size as
possible... I.e. a line 100mm (4 inches) should appear as 100mm on
screen!

A code snippet would be helpful! :-)

Best regards,
/J?rgen

 

Re:Vector graphics in scale?


You should use the SetMapMode and related API, in order to work with
metric (or inch) units instead of pixel. You can find code sample on my
web site (programming/graphic/form).

--
Eric SIBERT
http://www.multimania.com/esibert

Re:Vector graphics in scale?


You can't really do what you wish because the so called "dots per inch -
DPI" returned by most monitors in the windows device context is not
accurate.  Usually, it is either 72 dpi or 96 dpi.

The only way you can get an accurate scale is to have your user accurately
measure a line you have drawn, then use that difference ratio to adjust
your image size.

Quote
J?rgen H?gglund wrote:
> Hello World!

> Is there anyone out there who has an idea of how to do this:

> I want to draw a line on the screen (might be different resolutions or
> screen sizes), and I always want it to be as close to "natural" size as
> possible... I.e. a line 100mm (4 inches) should appear as 100mm on
> screen!

> A code snippet would be helpful! :-)

> Best regards,
> /J?rgen

Re:Vector graphics in scale?


CorelDraw has an interface to finetune this, separately for X and Y. Maybe
you get some ideas looking at it.

--

Alex Haerens
AHA-design

alexhaerens _at_ hotmail _dot_ com

Sue D. Nom <su...@courthouse.com> schreef in berichtnieuws
3A8417F6.E5F10...@courthouse.com...
| You can't really do what you wish because the so called "dots per inch -
| DPI" returned by most monitors in the windows device context is not
| accurate.  Usually, it is either 72 dpi or 96 dpi.
|
| The only way you can get an accurate scale is to have your user accurately
| measure a line you have drawn, then use that difference ratio to adjust
| your image size.
|

Quote
| J?rgen H?gglund wrote:

|
| > Hello World!
| >
| > Is there anyone out there who has an idea of how to do this:
| >
| > I want to draw a line on the screen (might be different resolutions or
| > screen sizes), and I always want it to be as close to "natural" size as
| > possible... I.e. a line 100mm (4 inches) should appear as 100mm on
| > screen!
| >
| > A code snippet would be helpful! :-)
| >
| > Best regards,
| > /J?rgen
|

Re:Vector graphics in scale?


"Sue D. Nom" <su...@courthouse.com> wrote in message
news:3A8417F6.E5F10ADC@courthouse.com...

Quote
> The only way you can get an accurate scale is to have your user accurately
> measure a line you have drawn, then use that difference ratio to adjust
> your image size.

There is an example of this type of calibration on the "Standard Observer"
tab of this project:
http://www.efg2.com/Lab/Graphics/Colors/Chromaticity.htm

I make the assumption the screen has a 4-to-3 aspect ration and require the
user to input the length of the screen diagonal in millimeters.  I store
this calibration information in an INI file.

With various adjustments that can be made to CRTs, having a separate "X" and
"Y" calibration factor may even be desirable if you want exact sizes to
appear on the screen.

--
efg          Earl F. Glynn, Overland Park, KS  USA

efg's Computer Lab:  http://www.efg2.com/Lab
Mirror:  http://homepages.borland.com/efg2lab/Default.htm

Re:Vector graphics in scale?


Thanx...
That was many suggestions/solutions/ideas/tips/informations in a short
while!
But I will investigate and check it all out...
If You come up with something else/more, please keep posting!!

Best regards
/J?rgen

Other Threads