I have a simple program to convert an image in a picture box into as grayscale image ,from what i have been told it is possible to then change that image in to a black and white image with certain levels of gray being converted to black and lower levels of gray being converted into white how would i do this here is my code to change into gray scale what would i need to add to this code
Private Sub cmdGray_Click() Pic.ScaleMode = vbPixels X = Pic.ScaleWidth y = Pic.ScaleHeight For i = 0 To y - 1 For j = 0 To X - 1 pixel = Pic.Point(j, i) red = pixel Mod 256 green = ((pixel And &HFF00) / 256& Mod 256& blue = (pixel And &HFF0000) / 65536
gs = ((red * 30) + (green * 59) + (blue * 11)) / 100 Pic.PSet (j, i), RGB(gs, gs, gs)
Next Next Pic.ScaleMode = vbTwips End Sub
thanks
|