VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Modifies the amount of red, green, or blue in an area of a picture box or form. Doesn't use Direct

by Walter Eigner (15 Submissions)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 12th April 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Modifies the amount of red, green, or blue in an area of a picture box or form. Doesn't use Direct X.

Rate Modifies the amount of red, green, or blue in an area of a picture box or form. Doesn't use Direct



Function ModifyGammaRect(obj As Object, x1 As Single, y1 As Single, x2 As Single, y2 As Single, R As Integer, G As Integer, B As Integer, Optional Quick As Boolean = False) As Boolean
On Local Error GoTo err:
obj.FillStyle = 1
obj.FillColor = RGB(Abs(R), Abs(G), Abs(B))
If Quick Then
obj.DrawMode = 15
obj.Line (x1, y1)-(x2, y2), RGB(Abs(R), Abs(G), Abs(B)), BF
Else
If R < 0 Then
obj.DrawMode = 3
obj.Line (x1, y1)-(x2, y2), RGB(Abs(R), 0, 0), BF
End If
If R > 0 Then
obj.DrawMode = 15
obj.Line (x1, y1)-(x2, y2), RGB(Abs(R), 0, 0), BF
End If
If G < 0 Then
obj.DrawMode = 3
obj.Line (x1, y1)-(x2, y2), RGB(0, Abs(G), 0), BF
End If
If G > 0 Then
obj.DrawMode = 15
obj.Line (x1, y1)-(x2, y2), RGB(0, Abs(G), 0), BF
End If
If B < 0 Then
obj.DrawMode = 3
obj.Line (x1, y1)-(x2, y2), RGB(0, 0, Abs(B)), BF
End If
If B > 0 Then
obj.DrawMode = 15
obj.Line (x1, y1)-(x2, y2), RGB(0, 0, Abs(B)), BF
End If
End If
ModifyGammaRect = True
obj.DrawMode = 13
Exit Function
err:
ModifyGammaRect = False
End Function

Function ModifyGammaCirc(obj As Object, x1 As Single, y1 As Single, Radius As Single, R As Integer, G As Integer, B As Integer, Optional Quick As Boolean = False) As Boolean
On Local Error GoTo err:
If Quick Then
obj.DrawMode = 15
obj.Circle (x1, y1), Radius, RGB(Abs(R), Abs(G), Abs(B))
Else
obj.FillStyle = 0
If R < 0 Then
obj.DrawMode = 3
obj.FillColor = RGB(Abs(R), 0, 0)
obj.Circle (x1, y1), Radius, RGB(Abs(R), 0, 0)
End If
If R > 0 Then
obj.DrawMode = 15
obj.FillColor = RGB(Abs(R), 0, 0)
obj.Circle (x1, y1), Radius, RGB(Abs(R), 0, 0)
End If
If G < 0 Then
obj.DrawMode = 3
obj.FillColor = RGB(0, Abs(G), 0)
obj.Circle (x1, y1), Radius, RGB(0, Abs(G), 0)
End If
If G > 0 Then
obj.DrawMode = 15
obj.FillColor = RGB(0, Abs(G), 0)
obj.Circle (x1, y1), Radius, RGB(0, Abs(G), 0)
End If
If B < 0 Then
obj.DrawMode = 3
obj.FillColor = RGB(0, 0, Abs(B))
obj.Circle (x1, y1), Radius, RGB(0, 0, Abs(B))
End If
If B > 0 Then
obj.DrawMode = 15
obj.FillColor = RGB(0, 0, Abs(B))
obj.Circle (x1, y1), Radius, RGB(0, 0, Abs(B))
End If
End If
obj.DrawMode = 13
ModifyGammaCirc = True
Exit Function
err:
ModifyGammaCirc = False
End Function

Download this snippet    Add to My Saved Code

Modifies the amount of red, green, or blue in an area of a picture box or form. Doesn't use Direct Comments

No comments have been posted about Modifies the amount of red, green, or blue in an area of a picture box or form. Doesn't use Direct . Why not be the first to post a comment about Modifies the amount of red, green, or blue in an area of a picture box or form. Doesn't use Direct .

Post your comment

Subject:
Message:
0/1000 characters