Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bData.ByteData(ii) = CByte(bData.ByteData(ii) + (amount * (255 - bData.ByteData(ii)))) 'blue
- Public Sub Brightness(Optional ByVal amount As Single = 0)
- OnFilterStarted()
- If amount = 0 Then Return
- Dim bData = BitmapData.LockBits(b)
- If amount > 0 Then
- For ii = bData.ByteData.GetLowerBound(0) To bData.ByteData.GetUpperBound(0) Step 4
- bData.ByteData(ii) = CByte(bData.ByteData(ii) + (amount * (255 - bData.ByteData(ii)))) 'blue
- bData.ByteData(ii + 1) = CByte(bData.ByteData(ii + 1) + (amount * (255 - bData.ByteData(ii + 1)))) 'green
- bData.ByteData(ii + 2) = CByte(bData.ByteData(ii + 2) + (amount * (255 - bData.ByteData(ii + 2)))) 'red
- Next
- Else
- For ii = bData.ByteData.GetLowerBound(0) To bData.ByteData.GetUpperBound(0) Step 4
- bData.ByteData(ii) = CByte(bData.ByteData(ii) - (Math.Abs(amount) * bData.ByteData(ii))) 'blue
- bData.ByteData(ii + 1) = CByte(bData.ByteData(ii + 1) - (Math.Abs(amount) * bData.ByteData(ii + 1))) 'green
- bData.ByteData(ii + 2) = CByte(bData.ByteData(ii + 2) - (Math.Abs(amount) * bData.ByteData(ii + 2))) 'red
- Next
- End If
- bData.UnlockBits()
- OnFilterFinished()
- End Sub
- Dim b As Byte
- Dim a As Single
- b = 128
- a = 30
- b += a * (255 - b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement