Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, June 18, 2007 5:23:14 AM(UTC)
massivekid

Groups: Registered
Posts: 5


   
When setting the RequestedImageSize of a dicom print imagebox, then you have to pass a double to this property.
If the Decimal Separator is setted to ',' (komma) in the local country settings, then leadtools convert this value to a decimal string with a ',' in it in stead of a '.' (point) which is the dicom standard. Therefore the size is not accepted by dicom printers.

Can this be altered and if so where can i do this without changing the country settings.
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, June 18, 2007 10:52:16 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


Unfortunately, there is nothing LEADTOOLS can do in regards to this problem.  This is because the RequestedImageSize returns a System.Double which is Microsoft's object.  When converting this Double to a string, Microsoft is doing this, not LEADTOOLS.  Therefore you are going to have to change the regional settings either permanently for the user of the computer or temporarily within your code.  Here's a couple links that might be useful:

http://www.thescripts.com/forum/thread567436.html
http://msdn2.microsoft.com/en-us/library/system.globalization.cultureinfo(VS.80).aspx
http://msdn2.microsoft.com/en-us/library/system.globalization.numberformatinfo(VS.80).aspx

I believe the actual property you'll need to change is the NumberFormatInto.NumberDecimalSeparator
 
#3 Posted : Monday, June 18, 2007 10:08:24 PM(UTC)
massivekid

Groups: Registered
Posts: 5


Can't you parse the string after the conversion to replace the local decimal separator to a '.' ?
Now you pass the double to the microsoft object and you are getting back a string with an invalid separator (according to dicom standard).

Is it not desired that this works on every system locale?
Changing the global separator gave problems in other programs that are only designed to work with a specific decimal separator.
 
#4 Posted : Wednesday, June 20, 2007 4:50:19 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


Yes, you can parse the string as well and raplace the ',' with '.' if that is your preferred method.  Unfortunately, there just isn't anything in LEADTOOLS that will make sure that your string representation of the RequestedImageSize always has the '.' because it's a Microsoft object.

Of course we would like it to work at every locale, which is exactly what we are doing.  If the globalization settings say that the double should use a ',' rather than a '.' then I would say it is working properly.  If anything is not working globally it's the dicom printers you are using since they will only accept a '.' for the decimal separator.  I apologize for the inconvenience, but parsing the string or changing the globalization settings are the only way I know of that you'd be able to guarantee that the string representation of your double will work with the printer you are using.
 
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.106 seconds.