Change bitmaps certain color transparency
- 'Written by Margus Martsepp AKA m2s87
- Private Function v2bista(ByRef OnPict As System.Drawing.Bitmap, _
- ByVal xColor As System.Drawing.Color, _
- ByVal How_Tr As Integer) As Boolean
- Dim x%, y%, R%, G%, B%
- v2bista = True
- With OnPict
- For x = 1 To .Width - 1
- For y = 1 To .Height - 1
- R = .GetPixel(x, y).R
- G = .GetPixel(x, y).G
- B = .GetPixel(x, y).B
- If xColor.R = R And xColor.G = G And xColor.B = B Then
- .SetPixel(x, y, System.Drawing.Color.FromArgb(How_Tr, R, G, B))
- End If
- Next
- Next
- End With
- End Function
No comments:
Post a Comment