Sub Camera1_Preview (PreviewPic() As Byte)
'prevent queued events from previous camera settings, if any. Just in case
If DateTime.Now > lastPreviewSaved + IntervalMs And (Processing = False) Then
lastPreviewSaved = DateTime.Now
'prevent queued events from previous camera settings, if any. Just in case
If PreviewPic.Length<>(3*myBitmap.Width*myScale*myBitmap.Height*myScale/2) Then
Log("Not processing")
Return
End If
NV21toRGB.proceed( PreviewPic, myBitmap.Width*myScale, myBitmap.Height*myScale, myScale, myBitmap, camVertical , camEx.Front, camEx.DispRotation, myIndexEffect )
myPreviewRGBArray = getPixels(myBitmap, 0, 0, 0, 0 , myBitmap.Width, myBitmap.Height)
Log(" freq = " & (DateTime.Now - LastTime))
'new method. Converts the PreviewPic() array to ARGB format in myPreviewRGBArray()
'NV21toRGB.proceedArray(PreviewPic, myBitmap.Width*myScale, myBitmap.Height*myScale, myScale, myPreviewRGBArray, camVertical , camEx.Front, camEx.DispRotation, 0)
'Dim centralColor As Int = myPreviewRGBArray( (myArrayWidth*myArrayHeight/2)+(myArrayWidth/2))
'Dim R As Int = Bit.And(Bit.ShiftRight(centralColor,16),0xFF)
'Dim G As Int = Bit.And(Bit.ShiftRight(centralColor, 8),0xFF)
'Dim B As Int = Bit.And(centralColor,0xFF)
'Log("CentralPoint RGB is (ARGB)="&R&","&G&","&B & " freq = " & (DateTime.Now - LastTime))
LastTime = DateTime.Now
'ComputeImage
End If
End Sub