Changeset 25 for Include/Classes/System
- Timestamp:
- Nov 30, 2006, 12:19:01 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/Drawing/Color.ab
r11 r25 18 18 Public 19 19 Sub Color() 20 Argb = 0 ' Black 20 argb = MakeARGB(255, 0, 0, 0) ' Black 21 End Sub 22 23 Sub Color(ByRef c As Color) 24 argb = c.argb 21 25 End Sub 22 26 … … 26 30 27 31 Sub Color(a As Byte, r As Byte, g As Byte, b As Byte) 28 Argb = MakeARGB(a, r, g, b)29 End Sub 30 31 Sub Color( argb As ARGB)32 Argb = argb32 argb = MakeARGB(a, r, g, b) 33 End Sub 34 35 Sub Color(newArgb As ARGB) 36 argb = newArgb 33 37 End Sub 34 38 35 39 Sub Operator =(c As Color) 36 SetValue(c)40 argb = c.argb 37 41 End Sub 38 42 … … 61 65 End Function 62 66 63 Function GetValue() As ARGB64 GetValue =argb65 End Function 66 67 Sub SetValue(value As ARGB)67 Function Value() As ARGB 68 Return argb 69 End Function 70 71 Sub Value(value As ARGB) 68 72 argb = value 69 73 End Sub 70 74 71 75 Sub SetFromCOLORREF(rgb As COLORREF) 72 argb = Color_MakeARGB(255, GetRValue(rgb), GetGValue(rgb), GetBValue(rgb)) 76 If (rgb And &hff000000) = &h01000000 Then 77 Exit Sub ' インデックス指定は無効 78 Else 79 argb = Color_MakeARGB(255, GetRValue(rgb), GetGValue(rgb), GetBValue(rgb)) 80 End If 73 81 End Sub 74 82 … … 91 99 End Function 92 100 93 Static Function FromArgb(r As Byte, g As Byte, b As Byte) 101 Static Function FromArgb(r As Byte, g As Byte, b As Byte) As Color 94 102 Dim c As Color(r, g, b) 95 103 Return c 96 104 End Function 97 105 98 Static Function FromArgb(a As Byte, r As Byte, g As Byte, b As Byte) 106 Static Function FromArgb(a As Byte, r As Byte, g As Byte, b As Byte) As Color 99 107 Dim c As Color(a, r, g, b) 100 108 Return c … … 297 305 End Enum 298 306 */ 299 ' Assemble A, R, G, B values into a 32-bit integer 300 Private 301 Static Function MakeARGB(/*IN*/ a As Byte, 302 /*IN*/ r As Byte, 303 /*IN*/ g As Byte, 304 /*IN*/ b As Byte) As ARGB 307 Static Function MakeARGB(a As Byte, r As Byte, g As Byte, b As Byte) As ARGB 305 308 MakeARGB = (((b As ARGB) << Color_BlueShift) Or _ 306 309 ((g As ARGB) << Color_GreenShift) Or _
Note:
See TracChangeset
for help on using the changeset viewer.