VB6 轉 Java
最 近工作上需要進行 VB6 轉 Java 語法,以下是轉檔遇到的問題及解決方式 平方,例如 2 的 3 次方 VB6 的平方是 ^ , 2 ^ 3 Java 的平方是 Math.pow(數值,平方) , Math.pow(2,3); Java Int 轉 Byte 最快方式 : (byte)數值 例如 int A = 16 ; byte B = (byte)A ; 顏色判斷方式 VB6 使用 Picture.Point(x,y) = RGB (n,n,n) Java 使用 Bitmap.getPixel(x,y) = Color.rgb(n,n,n) 或是使用下面方式分解出 ARGB 個別判斷 int ARGB = TargetPIC.getPixel(locX - 1, locDot - 1); int A = Color.alpha(ARGB); int R = Color.red(ARGB); int G = Color.green(ARGB); int B = Color.blue(ARGB); 陣列的宣告 VB6: Dim A(10) as Byte '0~10 Java: byte[] A = new byte[10]; // 0~9