In the .NET framework there is a Convert class which will convert a byte
array to a base64 string. I think the function is something like
Convert.ToBase64String.
The image data is then safe to return from the webservice as a string. The
client would then have to decode the base64 string back into a byte array, i
think using Convert.FromBase64String (if client is using .NET).
I can't remember off the top of my head how to convert a bitmap to a byte
array and then convert a byte array to a bitmap, but i think it's
straightforward.
Hope this helps,
Andrew
"Przemo" <Pr****@discussions.microsoft.comwrote in message
news:47**********************************@microsof t.com...
no, I havn't
How to encode such a content for Base-64? Can it be switched in web
service?
"Andrew Brook" wrote:
>Have you tried Base-64 encoding the contents of the bitmap to a string
and
sending that across the wire?
I suspect that a Bitmap was not intended as the result from a webservice
method call.
Andrew
"Przemo" <Pr****@discussions.microsoft.comwrote in message
news:A7**********************************@microso ft.com...
Hi,
I would like to have a web service method sending a bitmap image. But
code
like do not work:
<WebMethod()_
Public Function GetBitmap() As Drawing.Bitmap
Dim a As New Drawing.Bitmap("1.bmp", False)
Return a
End Function
When I test my web serwice I receive:
<?xml version="1.0" encoding="utf-8" ?>
- <Bitmap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://tempuri.org/">
<Palette />
</Bitmap>
<Paletteis empty, but image I try to send is a 100x100 pixels.
Any help?
Thanks.
Przemo