Private Function BufferFromImage(imageSource As BitmapImage) As Byte()
If Not IsNothing(imageSource) Then
Dim encoder As New BmpBitmapEncoder
encoder.Frames.Add(BitmapFrame.Create(imageSource))
Using ms As New MemoryStream
encoder.Save(ms)
Return ms.GetBuffer
End Using
End If
Return Nothing
End Function
That function takes a long processing speed. I want a faster process. What should I do?
(Not WindowsPhone. Used WPF VB.net)