0

我想开发一个像ms paint这样的silverlight项目。我找到一个例子。但它有一个问题。我无法将DrawingArea网格保存为图像文件或字节。我不知道如何将DrawingArea网格保存为字节。 plz帮助我将网格保存为字节

  <UserControl 
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="SilverlightPaintApplication.MainPage" 
      Width="805" Height="600" mc:Ignorable="d" BorderThickness="0,0,0,0" BorderBrush="{x:Null}"> 
      <Grid x:Name="LayoutRoot" Background="#FFFFFFFF" Width="Auto" > 

       ... 

      <Grid x:Name="DrawingArea" Margin="0,0,-5,8" MouseMove="DrawingArea_MouseMove" MouseLeftButtonDown="DrawingArea_MouseLeftButtonDown" MouseLeftButtonUp="DrawingArea_MouseLeftButtonUp" Background="#FFFFFFFF"/> 

       ... 

      </Grid> 
     </UserControl> 

回答