AlpVir Well-Known Member Licensed User Longtime User Oct 12, 2014 #1 Il seguente spezzone di codice B4A colora lo schermo di una tonalità di blu Code: Copy Dim coloreX As Long coloreX=Colors.RGB(50,109,179) Log(coloreX) Activity.Color = coloreX e stampa il numero del colore -13472333 Quest'altro spezzone (scritto in VB6) fa la medesima cosa (stesso colore) ma stampa un altro numero (11758898) Code: Copy Dim ColoreX As Long ColoreX = RGB(50, 109, 179) Debug.Print ColoreX BackColor = ColoreX Intuisco che ci deve essere una relazione tra i 2 numeri ma non so quale. Qualcuno mi sa dare un suggerimento ? Il tutto mi servirebbe per controllare la corretta trasposizione di codice da VB6 a B4A. Grazie.
Il seguente spezzone di codice B4A colora lo schermo di una tonalità di blu Code: Copy Dim coloreX As Long coloreX=Colors.RGB(50,109,179) Log(coloreX) Activity.Color = coloreX e stampa il numero del colore -13472333 Quest'altro spezzone (scritto in VB6) fa la medesima cosa (stesso colore) ma stampa un altro numero (11758898) Code: Copy Dim ColoreX As Long ColoreX = RGB(50, 109, 179) Debug.Print ColoreX BackColor = ColoreX Intuisco che ci deve essere una relazione tra i 2 numeri ma non so quale. Qualcuno mi sa dare un suggerimento ? Il tutto mi servirebbe per controllare la corretta trasposizione di codice da VB6 a B4A. Grazie.
S Sub7 Active Member Licensed User Longtime User Oct 12, 2014 #2 This is the english section of the forum not the Italian. Try change colors.rgb into colors.ARGB(255,50,109,179) and check if this could be the reason. Upvote 0
This is the english section of the forum not the Italian. Try change colors.rgb into colors.ARGB(255,50,109,179) and check if this could be the reason.
AlpVir Well-Known Member Licensed User Longtime User Oct 12, 2014 #3 I apologize for my mistake. However my problem is not born looking color but by the value of the number. Colors.rgb (50,109,179) = - 13472333 Colors.argb (255,50,109,179) = - 13472333 Colors.argb (0,50,109,179) = 0 Upvote 0
I apologize for my mistake. However my problem is not born looking color but by the value of the number. Colors.rgb (50,109,179) = - 13472333 Colors.argb (255,50,109,179) = - 13472333 Colors.argb (0,50,109,179) = 0
DonManfred Expert Licensed User Longtime User Oct 12, 2014 #4 AlpVir said: Colors.argb (0,50,109,179) = 0 Click to expand... The color is fully transparent. In fact is then could not have a color. I believe this results in color = 0 Upvote 0
AlpVir said: Colors.argb (0,50,109,179) = 0 Click to expand... The color is fully transparent. In fact is then could not have a color. I believe this results in color = 0
Straker Active Member Licensed User Longtime User Oct 12, 2014 #5 The problem is about how B4a uses numbers (signed). In B4a bytes ranges from-127 to 127, in VB6 from 0 to 255. So your '179' is used by b4a as a signed (negative) number. Your VB6 11758898 means 0xB36D32 (B3=179, 6D=109, 32=50) unsigned. The result in B4a is -13472333 which is a signed 0xFF326DB3. Upvote 0
The problem is about how B4a uses numbers (signed). In B4a bytes ranges from-127 to 127, in VB6 from 0 to 255. So your '179' is used by b4a as a signed (negative) number. Your VB6 11758898 means 0xB36D32 (B3=179, 6D=109, 32=50) unsigned. The result in B4a is -13472333 which is a signed 0xFF326DB3.