Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi, i have this function which mask two images, with 5mpx bitmap it's take more than 125 ms (depend of non white pixels).

I was thinking to make a linq sentece to do it, is there any way to make an AND operation between two list? Or a Where/Select condition to do this?


VB
Public Shared Function mascara(ByVal masc As Bitmap, ByVal ima As Bitmap) As Bitmap
        Try
            Dim msk As New List(Of Byte)
            Dim orim As New List(Of Byte)
            t1 = DateTime.Now
            msk.AddRange(imagen_byte(masc)(0))
            orim.AddRange(imagen_byte(ima)(0))
            t2 = DateTime.Now
            If msk.Count = orim.Count Then
                For i = 0 To msk.Count - 1
                    If msk(i) <> 0 Then
                        msk(i) = orim(i)
                    End If
                Next

            End If
            t3 = DateTime.Now
            Return byte_imagen(msk.ToArray, masc)
        Catch ex As Exception
            Return Nothing
        End Try
    End Function
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900