Pflichtfeld Active Member Licensed User Apr 8, 2020 #1 In this example, I find these lines: B4X: wc = bmpCompass.Width * 100dip / 100 hc = bmpCompass.Height * 100dip / 100 wn = bmpNeedle.Width * 100dip / 100 hn = bmpNeedle.Height * 100dip / 100 Would there be a difference to: B4X: wc = bmpCompass.Width * 1dip ... or to B4X: wc=(DipToCurrent(bmpCompass.Width)) ... or is there a reason for this "100dip/100"
In this example, I find these lines: B4X: wc = bmpCompass.Width * 100dip / 100 hc = bmpCompass.Height * 100dip / 100 wn = bmpNeedle.Width * 100dip / 100 hn = bmpNeedle.Height * 100dip / 100 Would there be a difference to: B4X: wc = bmpCompass.Width * 1dip ... or to B4X: wc=(DipToCurrent(bmpCompass.Width)) ... or is there a reason for this "100dip/100"
Jorge M A Well-Known Member Licensed User Longtime User Apr 8, 2020 #2 You can find the reason in this video tutorial: B4X Programming Video Tutorials www.b4x.com Upvote 0
Pflichtfeld Active Member Licensed User Apr 9, 2020 #3 Jorge M A said: You can find the reason in this video tutorial: Click to expand... thank you Jorge. At 9:25 Erel also uses 100dip/100, but does not explain why he takes this quotient and not just 1dip or dipTo Current. Upvote 0
Jorge M A said: You can find the reason in this video tutorial: Click to expand... thank you Jorge. At 9:25 Erel also uses 100dip/100, but does not explain why he takes this quotient and not just 1dip or dipTo Current.
Pflichtfeld Active Member Licensed User Apr 9, 2020 #4 I think, I found out the reason myself: DipToCurrent (Length As Int) As Int is the definition and I suppose, that that can be unexact in some cases, because it does not return a single or float? Is this the reason? Upvote 0
I think, I found out the reason myself: DipToCurrent (Length As Int) As Int is the definition and I suppose, that that can be unexact in some cases, because it does not return a single or float? Is this the reason?
klaus Expert Licensed User Longtime User Apr 9, 2020 #5 Yes. With scales of 0.75 and 1.5 it will be wrong. I remember also that InitializeMutable(1dip, 1dip) did through an error with a 0.75 scale. Upvote 0
Yes. With scales of 0.75 and 1.5 it will be wrong. I remember also that InitializeMutable(1dip, 1dip) did through an error with a 0.75 scale.
Pflichtfeld Active Member Licensed User Apr 9, 2020 #6 klaus said: Yes. With scales of 0.75 and 1.5 it will be wrong. Click to expand... Thank you Klaus! Upvote 0