i'm build 1 code for show\select 1 item\object in an image.
for now i can show the item\object in that color selection, but i only need the selection in line way and show the item\object.
i have the blnFirstPixel for try do the line, but isn't correctCode:Private Sub SelectionImage(Source As PictureBox, Destination As PictureBox, SelectionColor As Long) Dim x As Long, y As Long Dim blnFirstPixel As Boolean Dim lngBackColor As Long lngBackColor = GetPixel(Source.hdc, 0, 0) blnFirstPixel = False For y = 0 To Source.ScaleHeight - 1 For x = 0 To Source.ScaleWidth - 1 If GetPixel(Source.hdc, x, y) <> lngBackColor And blnFirstPixel = False Then blnFirstPixel = True SetPixel Destination.hdc, x, y, SelectionColor ElseIf GetPixel(Source.hdc, x, y) <> lngBackColor And blnFirstPixel = True Then SetPixel Destination.hdc, x, y, SelectionColor blnFirstPixel = False ElseIf GetPixel(Source.hdc, x, y) = lngBackColor And blnFirstPixel = False Then SetPixel Destination.hdc, x, y, GetPixel(Source.hdc, x, y) Else SetPixel Destination.hdc, x, y, GetPixel(Source.hdc, x, y) End If Next x Next y Destination.Refresh End Sub
can anyone advice me?
see the image in selection of rectangule(from black to green). i want do the same in these sub selections of itens(what is in image). thanks






Reply With Quote