Click to See Complete Forum and Search --> : Just wanted to know...
Coder79
July 29th, 1999, 03:10 AM
Hello everybody!
This text is from Finland so forgive me my lousy english. (Time = 10:55 pm)
I there a way to get a string length in mm (millimeter). I have a product code which cannot be longer than 64 mm. I have to scale it somehow if it's longer. I'm in a lots of trouble. Visual Basic's help doesn't help me. Can you???
Yours,
Michael
Lothar Haensler
July 29th, 1999, 04:14 AM
the GetTextExtentPoint32 API returns the size of a text in logical units.
You can then use the LPtoDP function to convert it. Also check out the SetMapMode API.
Coder79
July 30th, 1999, 12:26 AM
Hi!
Go Lothar go... Yeah, it worked! Thanks man. You're a real day saver. Thanks again.
Michael
Lothar Haensler
July 30th, 1999, 01:41 AM
Cool.
Would you post your code here?
I'd like to see that TextToMMConversion routine. It might be useful for all of us.
Coder79
July 30th, 1999, 02:11 AM
Another way of doing it (I finally decided to do it like this):
Dim TempHelp As String
Dim CodeLenght As Long
printer.scalemode = 6 'mm, can be anything (0-7)
TempHelp = "I love my country (Finland)"
CodeLenght = Printer.ScaleWidth(TempHelp)
'At this point CodeLenght will be in mm's. It depends what fontsize and fontname you are using but with a little tricky tricky stuff you'll get the comparing session nicely ended.
Hope this helps, that's how I did it. It works in my prog. By the way: production cards sucks.
Michael
Lothar Haensler
July 30th, 1999, 02:14 AM
That's really cool.
What does that mean?
>production cards sucks
what are production cards?
Coder79
July 30th, 1999, 02:22 AM
Here in our company we do product cards which are A4 size paper pieces. Maybe there are better way to express it, but in our language it's called 'tuotekortti'. One product has one card and in the card there are mentioned all the features of product. For example in the clothing business the card includes it's unique (product) number, it's color, codes and something like that. And the part where I said that it sucks. It means that I have learned to hate the cards. If you have a e-mail address. I could send you the next card I finish. If it's ok?
Michael
Lothar Haensler
July 30th, 1999, 02:26 AM
'tuotekortti'? I am intimidated :-)
Thanks for the information.
I don't think a could use such a thing.
Coder79
July 30th, 1999, 02:29 AM
OK =)
Michael
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.