M
Martin Widmer
Hi Folks
In my object I am trying to implement a function in order to render the
picture to XML (to generate RDL for SQL Server). That Function causes the
error mentioned in the subject at the marked line. I read various articles
about it but none of them seems to apply as I am not writing to a file or to
a response in ASP, instead it's a pure VB class that is used from a winforms
applciation. I am using VS 2005.
Private Function PictureToBase64(ByVal oPicture As Bitmap) As String
'Convert a bitmap to base64 encoded string for storage in RDL or XML
Dim sBase64 As String
Dim oMemory As New System.IO.MemoryStream()
'Save picture to stream'Convert stream to base64 encoded string
sBase64 = System.Convert.ToBase64String(oMemory.ToArray)
'Close stream and clean up
oMemory.Close()
oMemory = Nothing
Return sBase64
End Function
Thanks for suggestions
Martin
In my object I am trying to implement a function in order to render the
picture to XML (to generate RDL for SQL Server). That Function causes the
error mentioned in the subject at the marked line. I read various articles
about it but none of them seems to apply as I am not writing to a file or to
a response in ASP, instead it's a pure VB class that is used from a winforms
applciation. I am using VS 2005.
Private Function PictureToBase64(ByVal oPicture As Bitmap) As String
'Convert a bitmap to base64 encoded string for storage in RDL or XML
Dim sBase64 As String
Dim oMemory As New System.IO.MemoryStream()
'Save picture to stream'Convert stream to base64 encoded string
sBase64 = System.Convert.ToBase64String(oMemory.ToArray)
'Close stream and clean up
oMemory.Close()
oMemory = Nothing
Return sBase64
End Function
Thanks for suggestions
Martin