Here is the code that will appear on the screen of your silverlight application. and then you can send it or something else :-)
Just create a silverlight project (with a normal main page, etc.) and replace it.
works in both 3.0 and 4.0 (havent tried 2.0 and below)
Hope I help Regards, ReLoad
.cs
System; System.Collections.Generic; System.Linq; System.Net; System.Windows; System.Windows.Controls; System.Windows.Documents; System.Windows.Input; System.Windows.Media; System.Windows.Media.Animation; System.Windows.Shapes; System.Windows.Data; System.Windows.Media.Imaging;
SilverlightApplication1 { public partial class MainPage: UserControl { public MainPage() { InitializeComponent(); }
private void UIelementShoot(object sender,
RoutedEventArgs e) { theImageToSend.Source = new WriteableBitmap (elementToCapture, ); }
private void ScreenShoot(object sender,
RoutedEventArgs e) { theImageToSend.Source = new WriteableBitmap (LayoutRoot, null); }
private void Button_Click(object sender,
RoutedEventArgs e) {
}
} }
XAML:
<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"
xmlns:local="clr-namespace:SilverlightApplication1" x:Class="SilverlightApplication1.MainPage"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White" Width="400" Height="300" >
<Image x:Name="theImageToSend" Margin="191,56,44,103" d:LayoutOverrides="HorizontalAlignment"/>
<TextBox x:Name="elementToCapture" Margin="37,56,0,130" TextWrapping="Wrap" Text="TextBox" Width="124" HorizontalAlignment="Left" d:LayoutOverrides="Width"/>
<Button Content="Make ScreenShoot" HorizontalAlignment="Right" Margin="0,0,44,26" VerticalAlignment="Bottom" Width="139" Click="ScreenShoot"/>
<Button Content="Make TextBox Shoot" HorizontalAlignment="Left" Margin="61,0,0,26" VerticalAlignment="Bottom" Width="139" Click="UIelementShoot"/>
</Grid>
</UserControl>