0

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

            <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>
4

1 回答 1

2

我相信解决方案是使用可写位图并将其保存,如此处所述

于 2012-04-25T18:24:56.930 回答