This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Notification

Icon
Error

Options
Go to last post Go to first unread
mtb7597  
#1 Posted : Thursday, May 21, 2009 10:15:51 PM(UTC)
mtb7597

Rank: Newbie

Groups: Guest
Joined: 5/21/2009(UTC)
Posts: 1

We are upgrading an old application to the .net framework and we decided on using the graphics mill component for our graphic needs. The old imaging component was using pixels to draw annotation.

As it was pointed in another thread, when adding annotations, the coordinates used are points (and not the unit set on the layer). My question comes when I have to convert the pixels to points (and back to pixel when saving). I found the following operation in this thread : Can't get pixel coordinates from VObject Points.

Originally Posted by: " Go to Quoted Post
Unit.Pixel property doesn't affect on coordinates of the VObjects, they are always measured in points. So you should convert them into pixels by yourself (in most cases it will be: points * 96 / 72 = pixels)


I understand there is always 72 points per inches, that might be a constant; what I can't understand is the 96! I played with the layer, the GDI Graphics (either from Aurigma or from the .NET Framework) and I can't find something that will give me 96. The calculation is working great on my computer, but will it work on every computer? The "in most cases it will be" is bothering me since our software is critical to the operation of our customers.

Any enlightment will be greatly appreciated! Thank you
tcrosbie  
#2 Posted : Sunday, May 24, 2009 11:56:02 AM(UTC)
tcrosbie

Rank: Advanced Member

Groups: Guest
Joined: 6/22/2008(UTC)
Posts: 27

96 dpi is typically the screen resolution of the monitor. I'd probably be using something like ViewerResolution, which is a property of wincontrols, I know the multilayer control has this, I'm pretty sure the bitmap control will too.

ViewerResolution will remove the 'in most cases' and give you the correct result. In most cases it will return 96, but as you are using this you don't have to rely on 96 as a magic hardcoded number :)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.