sorry i posted in the classic forum to begin with ...
im running the following code below to replace colours .... the code works fine but i need a way to break down RGB values to calculate if the colour is roughly in the same range as the image .... how can i do this
any help would be great
many thanks
illskills
VB Code:
Dim mycc As New ColorConverter pgbProgress.Maximum = 256 For iColour As Integer = 0 To 255 pgbProgress.Value = iColour pgbProgress.Refresh() If Not IsNothing(arrColoursToReplace(iColour)) Then For i As Integer = 1 To 1000 '# loops throught mosaics If IsNothing(arrCustomMosaics(i, 0, 0)) Then Exit For For x As Integer = 1 To 15 For y As Integer = 1 To 15 If Not IsNothing(arrCustomMosaics(i, x, y)) Then If mycc.ConvertToString(arrCustomMosaics(i, x, y).ToString) = mycc.ConvertToString(arrColoursToReplace(iColour).ToString) Then arrColoursToReplace(iColour) = arrCustomMosaics(i, 0, 0) End If End If Next Next Next End If Next For i As Integer = 1 To 255 If Not IsNothing(arrColoursToReplace(i)) Then txtmytextbox.Text = txtmytextbox.Text & vbCrLf & arrColoursToReplace(i).tostring End If Next


Reply With Quote