Why can’t "If" verify equality between Ctype(double, int32) with int32?

Asked

Viewed 44 times

1

I have a function that returns me a Double and need to check if the result is equal to 5000. I am using If CType(resultadoFunção as double, Int32) = 5000 Then, but though he shows 5000, he does not return True. Why?

 Private Async Sub Teste1()
    'Necessário Engucv
    'Imports Emgu.CV

    'vid = caminho de algum video
    Capiture = New VideoCapture(vid)

    While True
        Dim m As New Mat
        Capiture.Read(m)
        PictureBox1.Image = m.Bitmap
        Label1.Text = CType(Capiture.GetCaptureProperty(CvEnum.CapProp.PosMsec), Int32).ToString
        Await Task.Delay(42)

        If CType(Capiture.GetCaptureProperty(CvEnum.CapProp.PosMsec), Int32) = 5000 Then
            'Faz algo
        End If
    End While
End Sub

1 answer

1


Browser other questions tagged

You are not signed in. Login or sign up in order to post.