- Home
·
- Graphics
·
- very simple code to convert a picturebox picture into negative or convert a negative picture to col
very simple code to convert a picturebox picture into negative or convert a negative picture to col
very simple code to convert a picturebox picture into negative or convert a negative picture to color.
Rate very simple code to convert a picturebox picture into negative or convert a negative picture to col
(1(1 Vote))
For i = 0 To Picture1.ScaleHeight - 1
For j = 0 To Picture1.ScaleWidth - 1
'pulling out values of RGB
pixel = Picture1.Point(j, i)
red = pixel& Mod 256
green = ((pixel And &HFF00) / 256&) Mod 256&
blue = (pixel And &HFF0000) / 65536
'flipping colors to the other side of the color range
'(essientally if it is
'20% of the 255 range it becomes 80%, if it is 30% of the 255
'range it becomes 70%. The midpoint is around 128)
red = 255 * (1 - red / 255)
green = 255 * (1 - green / 255)
blue = 255 * (1 - blue / 255)
Picture1.PSet (j, i), RGB(red, green, blue)
Next
Next
very simple code to convert a picturebox picture into negative or convert a negative picture to col Comments
No comments yet — be the first to post one!
Post a Comment