<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD><TITLE>MgByteSink ToFile method?</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.5730.11" name=GENERATOR><!--[if !mso]>
<STYLE>v\:* {
        BEHAVIOR: url(#default#VML)
}
o\:* {
        BEHAVIOR: url(#default#VML)
}
w\:* {
        BEHAVIOR: url(#default#VML)
}
.shape {
        BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]-->
<STYLE>@font-face {
        font-family: Tahoma;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: blue; TEXT-DECORATION: underline
}
P {
        FONT-SIZE: 12pt; MARGIN-LEFT: 0in; MARGIN-RIGHT: 0in; FONT-FAMILY: "Times New Roman"; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
SPAN.EmailStyle18 {
        COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply
}
DIV.Section1 {
        page: Section1
}
</STYLE>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US vLink=blue link=blue>
<DIV dir=ltr align=left><SPAN class=419290604-30012007><FONT face=Arial
color=#0000ff size=2>Thanks Steve. I had something wrong with my path and
finally got it right. This works very well - I'm able to write a map
created with the rendering service API directly to the file system. And,
the PNG transparency is preserved which is something the .NET Imaging assembly
cannot currently do if you create a bitmap and write it to the file
system.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=419290604-30012007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=419290604-30012007><FONT face=Arial
color=#0000ff size=2>Thanks again.</FONT></SPAN></DIV>
<DIV> </DIV><!-- Converted from text/rtf format -->
<P><SPAN lang=en-us><FONT face=Tahoma size=1>Andy </FONT></SPAN><BR></P>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> mapguide-users-bounces@lists.osgeo.org
[mailto:mapguide-users-bounces@lists.osgeo.org] <B>On Behalf Of </B>Steve
Dang<BR><B>Sent:</B> Monday, January 29, 2007 6:48 PM<BR><B>To:</B> MapGuide
Users Mail List<BR><B>Subject:</B> RE: [mapguide-users] MgByteSink ToFile
method?<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Hi
Andy,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Here is some sample
code:<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">
<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=#003366 size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: #003366; FONT-FAMILY: Arial">
MgByteSource byteSource = new MgByteSource(“Testing”, 7);<BR>
byteSource.SetMimeType(“text/plain”);<BR> MgByteReader
byteReader = byteSource.GetReader();<BR> MgByteSink byteSink =
new MgByteSink (byteReader);<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=#003366 size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: #003366; FONT-FAMILY: Arial">
byteSink.ToFile(“C:\\Temp\\data.txt”);<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Hope this
helps.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Steve.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
mapguide-users-bounces@lists.osgeo.org
[mailto:mapguide-users-bounces@lists.osgeo.org] <B><SPAN
style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Andy Morsell<BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Monday, January 29, 2007 6:38
PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> 'MapGuide Users Mail
List'<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> [mapguide-users]
MgByteSink ToFile method?</SPAN></FONT><o:p></o:p></P></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">How
is the MgByteSink::ToFile method succesfully used? When I attempt to
utilize it in a .NET program, I get the following error message no matter
what I use for the path:</SPAN></FONT><o:p></o:p></P>
<P><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">A file IO
exception occurred: test.pngA file IO exception occurred: test.png Exception
occurred in method MgByteSink.ToFile at line 220 in file
c:\build_tux_area\mgdev\common\service\data\ByteSink.cpp
<o:p></o:p></SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thank you.</SPAN></FONT>
<o:p></o:p></P>
<P><FONT face=Tahoma size=1><SPAN
style="FONT-SIZE: 7.5pt; FONT-FAMILY: Tahoma">Andy Morsell, P.E.</SPAN></FONT>
<BR><FONT face=Tahoma size=1><SPAN
style="FONT-SIZE: 7.5pt; FONT-FAMILY: Tahoma">Spatial Integrators,
Inc.</SPAN></FONT> <BR><A href="http://www.SpatialGIS.com"><FONT face=Tahoma
size=1><SPAN
style="FONT-SIZE: 7.5pt; FONT-FAMILY: Tahoma">http://www.SpatialGIS.com</SPAN></FONT></A>
<o:p></o:p></P></DIV></BODY></HTML>