xb = x + b
dimana x = adalah nilai derajat keabuan
b = nilai penambah
xb = hasil brightness
Adapun contoh praktikum sbb :

Listing program Brightness sebagai berikut :
Private Sub HScroll2_Change()
bg = Val(HScroll2)
For i = 1 To Picture1.Width Step 15
For j = 1 To Picture1.Height Step 15
warna = Picture1.Point(i, j)
R = warna And RGB(255, 0, 0)
G = Int((warna And RGB(0, 255, 0)) / 256)
B = Int(Int((warna And RGB(0, 0, 255)) / 256) / 256)
xb1 = R + bg
xb2 = G + bg
xb3 = B + bg
Picture2.PSet (i, j), RGB(xb1, xb2, xb3)
Next j
Next i
End Sub
No comments:
Post a Comment