<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I have not used this for a while, as I found it borderline useless with
the reader complications.<br>
<br>
As I recall, you cannot exhaust the MgByteReader by a single call.<br>
You must itterate over the reader, and read 8K blocks for each
itteration.<br>
<br>
As I wrote, you should be able to find working code by searhing the
posts.<br>
If you find it, the Code Wiki is at:<br>
<a class="moz-txt-link-freetext" href="http://trac.osgeo.org/mapguide/wiki/CodeSamples">http://trac.osgeo.org/mapguide/wiki/CodeSamples</a><br>
<pre class="moz-signature" cols="72">Regards, Kenneth, GEOGRAF A/S
</pre>
<br>
<br>
monegodj skrev:
<blockquote cite="mid:14035945.post@talk.nabble.com" type="cite">
  <pre wrap="">This snippet is where I connect to the rendering service, call it, and then
write to the HTML response (and to file, to test the call). I've cut out
setting up the selection and the map connection (sel and map) to keep this
brief.


        ...

        MgRenderingService sRendering =
(MgRenderingService)connection.CreateService(MgServiceType.RenderingService);
        MgByteReader mapguideImageData = sRendering.RenderMap(map, sel,
"JPG");
        byte[] imageData = new byte[mapguideImageData.GetLength()];
        mapguideImageData.Read(imageData, 0);
        Response.ContentType = mapguideImageData.GetMimeType();
        Response.BinaryWrite(imageData);
        Response.End();
        FileStream f = (new
FileInfo(@"D:\test.jpg")).Open(FileMode.OpenOrCreate, FileAccess.Write);
        using(f)
        {
            foreach(byte b in imageData)
            {
                f.WriteByte(b);
            }
        }


Kenneth, GEOGRAF A/S wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">I have worked some with the rendering service in .Net.
Is the byte array the size you expect?
Can you post a code snippet with the code you try to run?

Regards, Kenneth, GEOGRAF A/S

    </pre>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
</blockquote>
</body>
</html>