Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. bData.ByteData(ii) = CByte(bData.ByteData(ii) + (amount * (255 - bData.ByteData(ii)))) 'blue
  2.  
  3. Public Sub Brightness(Optional ByVal amount As Single = 0)
  4. OnFilterStarted()
  5. If amount = 0 Then Return
  6. Dim bData = BitmapData.LockBits(b)
  7. If amount > 0 Then
  8. For ii = bData.ByteData.GetLowerBound(0) To bData.ByteData.GetUpperBound(0) Step 4
  9. bData.ByteData(ii) = CByte(bData.ByteData(ii) + (amount * (255 - bData.ByteData(ii)))) 'blue
  10. bData.ByteData(ii + 1) = CByte(bData.ByteData(ii + 1) + (amount * (255 - bData.ByteData(ii + 1)))) 'green
  11. bData.ByteData(ii + 2) = CByte(bData.ByteData(ii + 2) + (amount * (255 - bData.ByteData(ii + 2)))) 'red
  12. Next
  13. Else
  14. For ii = bData.ByteData.GetLowerBound(0) To bData.ByteData.GetUpperBound(0) Step 4
  15. bData.ByteData(ii) = CByte(bData.ByteData(ii) - (Math.Abs(amount) * bData.ByteData(ii))) 'blue
  16. bData.ByteData(ii + 1) = CByte(bData.ByteData(ii + 1) - (Math.Abs(amount) * bData.ByteData(ii + 1))) 'green
  17. bData.ByteData(ii + 2) = CByte(bData.ByteData(ii + 2) - (Math.Abs(amount) * bData.ByteData(ii + 2))) 'red
  18. Next
  19. End If
  20. bData.UnlockBits()
  21. OnFilterFinished()
  22. End Sub
  23.  
  24. Dim b As Byte
  25. Dim a As Single
  26.  
  27. b = 128
  28. a = 30
  29.  
  30. b += a * (255 - b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement