【问题标题】:Save a grid as bytes将网格保存为字节
【发布时间】:2012-04-25 14:18:52
【问题描述】:

我想开发一个类似 ms paint 的 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>

【问题讨论】:

    标签: silverlight silverlight-4.0 silverlight-3.0 silverlight-toolkit silverlight-5.0


    【解决方案1】:

    我相信解决方案是使用Writeable Bitmap 并将其保存在as explained here 之外。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-10-18
      • 1970-01-01
      • 2022-01-14
      • 2023-04-02
      • 2022-12-12
      • 1970-01-01
      • 1970-01-01
      • 2019-07-31
      相关资源
      最近更新 更多