Results 1 to 30 of 30

Thread: [VB6 - API] - selection of an item\image graphic effect

Threaded View

  1. #1

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,966

    [VB6 - API] - selection of an item\image graphic effect

    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.
    Code:
    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
    i have the blnFirstPixel for try do the line, but isn't correct
    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
    Attached Images Attached Images  
    VB6 2D Sprite control

    To live is difficult, but we do it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width