<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Silverlight API- Map Screenshot into Base64string and save in Database in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-api-map-screenshot-into-base64string/m-p/549239#M14028</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Any help to all of us newbies that dont know how to go about this . . . .&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Apr 2011 17:00:19 GMT</pubDate>
    <dc:creator>LuisCÃ_spedes</dc:creator>
    <dc:date>2011-04-20T17:00:19Z</dc:date>
    <item>
      <title>Silverlight API- Map Screenshot into Base64string and save in Database</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-api-map-screenshot-into-base64string/m-p/549235#M14024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I used WriteableBitmap to take the screenshot of the Image and convert that into Base64 string using FJCore. Due to Domain Issues with WriteableBitmap I am not able to read Pixels from WriteableBitmap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;getting the following Security error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"WriteableBitmap has protected content. Pixel access is not allowed."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Method Used to convert WritableBitmap to base64string:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; public static string ConvertImagetoString(WriteableBitmap bitmap)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; int width = bitmap.PixelWidth;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; int height = bitmap.PixelHeight;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; int bands = 3;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; byte[][,] raster = new byte[bands][,];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; for (int i = 0; i &amp;lt; bands; i++)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; raster&lt;I&gt; = new byte[width, height];&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; int[] bitpixes = bitmap.Pixels.ToArray();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; for (int row = 0; row &amp;lt; height; row++)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; for (int column = 0; column &amp;lt; width; column++)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; int pixel = bitpixes[width * row + column];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; raster[0][column, row] = (byte)(pixel &amp;gt;&amp;gt; 16);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; raster[1][column, row] = (byte)(pixel &amp;gt;&amp;gt; 8);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; raster[2][column, row] = (byte)pixel;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ColorModel model = new ColorModel { colorspace = FluxJpeg.Core.ColorSpace.RGB };&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; FluxJpeg.Core.Image img = new FluxJpeg.Core.Image(model, raster);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; MemoryStream stream = new MemoryStream();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; JpegEncoder encoder = new JpegEncoder(img, 90, stream);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; encoder.Encode(); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; stream.Seek(0, SeekOrigin.Begin);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; byte[] binaryData = new Byte[stream.Length];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; long bytesRead = stream.Read(binaryData, 0, (int)stream.Length);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; string base64String = System.Convert.ToBase64String(binaryData, 0, binaryData.Length);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; return base64String;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Function call:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; WriteableBitmap redlinescreenshot = new WriteableBitmap(this.TheMap, new TranslateTransform());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; string base64String = ConvertImagetoString(redlinescreenshot);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help Appreciated...Urgent!!!! Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Dec 2010 20:22:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-api-map-screenshot-into-base64string/m-p/549235#M14024</guid>
      <dc:creator>YamunadeviRathinasamy</dc:creator>
      <dc:date>2010-12-03T20:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Silverlight API- Map Screenshot into Base64string and save in Database</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-api-map-screenshot-into-base64string/m-p/549236#M14025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You are getting that error because you are trying to read the pixels of an image that contains pixels merged from images coming from a different domain than your .xap file. For security reasons, silverlight will block pixel read access to any images (or composites) coming from a different domain.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You got two options:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Use a proxy on your local server where the .xap recides and use the ProxyUrl to route the image download through that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Upgrade to v2.1. v2.1 uses a different approach for retrieving images, so for most services you won't see this issue (however there still might be some layers that doesn't use this approach).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Dec 2010 22:08:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-api-map-screenshot-into-base64string/m-p/549236#M14025</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2010-12-04T22:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Silverlight API- Map Screenshot into Base64string and save in Database</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-api-map-screenshot-into-base64string/m-p/549237#M14026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Yamuna,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is your issue resolved? I have a similar requirement where I need to convert Map into Byte array.Can you please share your solution/Code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For your reference I am using Silvelight api 2.1&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2011 06:12:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-api-map-screenshot-into-base64string/m-p/549237#M14026</guid>
      <dc:creator>komalagarwal</dc:creator>
      <dc:date>2011-03-09T06:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Silverlight API- Map Screenshot into Base64string and save in Database</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-api-map-screenshot-into-base64string/m-p/549238#M14027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i face the same problem how we can craet the proxy or how we can send the map image to wcf service&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Apr 2011 11:59:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-api-map-screenshot-into-base64string/m-p/549238#M14027</guid>
      <dc:creator>MohamedAhmed</dc:creator>
      <dc:date>2011-04-16T11:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Silverlight API- Map Screenshot into Base64string and save in Database</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-api-map-screenshot-into-base64string/m-p/549239#M14028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Any help to all of us newbies that dont know how to go about this . . . .&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2011 17:00:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-api-map-screenshot-into-base64string/m-p/549239#M14028</guid>
      <dc:creator>LuisCÃ_spedes</dc:creator>
      <dc:date>2011-04-20T17:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Silverlight API- Map Screenshot into Base64string and save in Database</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-api-map-screenshot-into-base64string/m-p/549240#M14029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I resolved this issue by deploying the app into my webserver which is my SOM as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The Mapservice path is same as the webserver path, same domain so I am getting the Map bitmap pixels.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2011 19:51:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-api-map-screenshot-into-base64string/m-p/549240#M14029</guid>
      <dc:creator>YamunadeviRathinasamy</dc:creator>
      <dc:date>2011-04-26T19:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Silverlight API- Map Screenshot into Base64string and save in Database</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-api-map-screenshot-into-base64string/m-p/549241#M14030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I resolved this issue using the first approach mentioned by &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/members/17-SharpGIS" rel="nofollow"&gt;SharpGIS&lt;/A&gt;&lt;SPAN&gt;. You can download the ashx generic handler that serves as the proxy &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/help/SLProxyPage.zip" rel="nofollow"&gt;&lt;SPAN style="text-decoration:underline;"&gt;here&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;. The readme file explains how to edit the config file to direct service requests through the proxy.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2011 06:45:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-api-map-screenshot-into-base64string/m-p/549241#M14030</guid>
      <dc:creator>KalongiDrake</dc:creator>
      <dc:date>2011-05-05T06:45:17Z</dc:date>
    </item>
  </channel>
</rss>

