WpfD3DInterop sample application
This demonstrates using D3D11Image components to host DirectX 11 rendered content in a WPF 4.5 (or later) application. The D3D11Image components can be used from NuGet or you can build them yourself from src\
|
@ -0,0 +1,8 @@
|
|||
<Application x:Class="Microsoft.Samples.Wpf.D3D11Interop.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -0,0 +1,11 @@
|
|||
namespace Microsoft.Samples.Wpf.D3D11Interop
|
||||
{
|
||||
using System.Windows;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
После Ширина: | Высота: | Размер: 61 KiB |
После Ширина: | Высота: | Размер: 1.2 KiB |
После Ширина: | Высота: | Размер: 1.0 KiB |
После Ширина: | Высота: | Размер: 48 KiB |
После Ширина: | Высота: | Размер: 1.1 KiB |
После Ширина: | Высота: | Размер: 1.3 KiB |
После Ширина: | Высота: | Размер: 1.5 KiB |
|
@ -0,0 +1,168 @@
|
|||
<Window x:Class="Microsoft.Samples.Wpf.D3D11Interop.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Microsoft.Wpf.Interop;assembly=Microsoft.Wpf.Interop.D3D11Image"
|
||||
Title="WPF D3D11 Interop" Height="540" Width="900" Closing="Window_Closing">
|
||||
|
||||
<Window.Resources>
|
||||
<SolidColorBrush x:Key="MediumGreyBrush" Color="#ff4e4e4e"/>
|
||||
<SolidColorBrush x:Key="KinectPurpleBrush" Color="#ff52318f"/>
|
||||
<Style TargetType="{x:Type CheckBox}" x:Key="SquareCheckBox">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type CheckBox}">
|
||||
<Grid>
|
||||
<StackPanel Orientation="Horizontal" Background="Transparent">
|
||||
<Grid x:Name="SquareCheckBoxChecked">
|
||||
<Image x:Name="CheckedNormal" Source="Images\Checkbox_checked.png" Stretch="None" HorizontalAlignment="Center"/>
|
||||
</Grid>
|
||||
<Grid x:Name="SquareCheckBoxUnchecked" Visibility="Collapsed">
|
||||
<Image x:Name="UncheckedNormal" Source="Images\Checkbox_unchecked.png" Stretch="None" HorizontalAlignment="Center"/>
|
||||
</Grid>
|
||||
<TextBlock x:Name="SquareCheckBoxText" Text="Recreate Surface on Resize" TextAlignment="Left" VerticalAlignment="Center" FontSize="15" Margin="9,0,0,0"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="false">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="SquareCheckBoxChecked"/>
|
||||
<Setter Property="Visibility" Value="Visible" TargetName="SquareCheckBoxUnchecked"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type RadioButton}" x:Key="KinectRadioButton">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type RadioButton}">
|
||||
<Grid>
|
||||
<Grid x:Name="KinectRadioButtonOnSet" HorizontalAlignment="Left">
|
||||
<Image Source="Images\radiobutton_on.png" Stretch="None"/>
|
||||
</Grid>
|
||||
<Grid x:Name="KinectRadioButtonOnUnset" HorizontalAlignment="Left" Visibility="Collapsed">
|
||||
<Image Source="Images\radiobutton_off.png" Stretch="None"/>
|
||||
</Grid>
|
||||
<TextBlock x:Name="KinectRadioButton" Text="{TemplateBinding Content}" TextAlignment="Left" VerticalAlignment="Center" FontSize="15" Margin="25,0,0,0"/>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="false">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="KinectRadioButtonOnSet"/>
|
||||
<Setter Property="Visibility" Value="Visible" TargetName="KinectRadioButtonOnUnset"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!--Create a slider background like the standard one-->
|
||||
<LinearGradientBrush x:Key="HorizontalSliderTrackNormalBorder" EndPoint="0,1" StartPoint="0,0">
|
||||
<GradientStop Color="#FFAEB1AF" Offset="0.1"/>
|
||||
<GradientStop Color="White" Offset=".9"/>
|
||||
</LinearGradientBrush>
|
||||
|
||||
<Style x:Key="KinectSlider"
|
||||
TargetType="{x:Type Slider}">
|
||||
<Setter Property="Orientation" Value="Horizontal" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Slider}">
|
||||
<Grid>
|
||||
<Border Background="#FFE7EAEA" BorderBrush="{StaticResource HorizontalSliderTrackNormalBorder}" BorderThickness="1" CornerRadius="1" Margin="5,0" Height="4.0" Grid.Row="1"/>
|
||||
<Track Visibility="Visible" x:Name="PART_Track">
|
||||
<Track.Thumb>
|
||||
<Thumb>
|
||||
<Thumb.Template>
|
||||
<ControlTemplate>
|
||||
<Image Source="Images/Slider.png"/>
|
||||
</ControlTemplate>
|
||||
</Thumb.Template>
|
||||
</Thumb>
|
||||
</Track.Thumb>
|
||||
</Track>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
|
||||
<Grid Margin="10,0,10,10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="62" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="250" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid Grid.Row="1" ClipToBounds="True">
|
||||
<Border Name="ControlHostElement"
|
||||
BorderBrush="{StaticResource KinectPurpleBrush}"
|
||||
BorderThickness="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid x:Name="host" Cursor="None">
|
||||
<Rectangle Grid.Column="0" Fill="Black"/>
|
||||
<Image Name ="Backdrop" Source="Images\Background.jpg"/>
|
||||
<Image Stretch="Fill" Name="ImageHost" >
|
||||
<Image.Source>
|
||||
<local:D3D11Image x:Name="InteropImage" />
|
||||
</Image.Source>
|
||||
</Image>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Canvas x:Name="MagCurserToggle2">
|
||||
<Ellipse x:Name="MagEllipse" Visibility="Hidden">
|
||||
<Ellipse.Fill>
|
||||
<VisualBrush x:Name="MagBrush" ViewboxUnits="Absolute"
|
||||
Visual="{Binding ElementName=ControlHostElement}"/>
|
||||
</Ellipse.Fill>
|
||||
</Ellipse>
|
||||
</Canvas>
|
||||
<Canvas x:Name="MagCurserToggle1" Cursor="None">
|
||||
<Image Name ="MagImage" Source="Images\MagnifyingGlass.png" Visibility="Hidden"/>
|
||||
</Canvas>
|
||||
</Grid>
|
||||
|
||||
<Rectangle Grid.Column="1" Fill="{StaticResource MediumGreyBrush}" Margin="10,0,0,0"/>
|
||||
<StackPanel Grid.Column="1">
|
||||
<Grid Margin="20,10,10,10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="35"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="15"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="15"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="50"/>
|
||||
<RowDefinition Height="35"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="15"/>
|
||||
<RowDefinition Height="25"/>
|
||||
<RowDefinition Height="15"/>
|
||||
<RowDefinition Height="25"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0" Text="Magnifier" HorizontalAlignment="Left" FontSize="20" FontFamily="Segeo UI" Foreground="White"/>
|
||||
<RadioButton Grid.Row="1" x:Name="MagBox" Style="{StaticResource KinectRadioButton}" IsChecked="True" FontSize="12" FontFamily="Segeo UI" Foreground="White" Content="On"/>
|
||||
<RadioButton Grid.Row="1" x:Name="MagBox2" Style="{StaticResource KinectRadioButton}" IsChecked="False" FontSize="12" FontFamily="Segeo UI" Foreground="White" Content="Off" Margin="60,0"/>
|
||||
<Label Grid.Row="3" HorizontalAlignment="Left" Content="_Size" VerticalAlignment="Center" FontSize="12" FontFamily="Segeo UI" Foreground="White" Target="{Binding ElementName=Size}"/>
|
||||
<Slider Grid.Row="3" x:Name="Size" Style="{StaticResource KinectSlider}" Minimum="30" Maximum="300" Value="100" ValueChanged="Size_ValueChanged" Margin="50,0,30,0" FontSize="12" FontFamily="Segeo UI" Foreground="White"/>
|
||||
<Label Grid.Row="5" HorizontalAlignment="Left" Content="_Scale" VerticalAlignment="Center" FontSize="12" FontFamily="Segeo UI" Foreground="White" Target="{Binding ElementName=Scale}"/>
|
||||
<Slider Grid.Row="5" x:Name="Scale" Style="{StaticResource KinectSlider}" Minimum="1" Value="2" Maximum="5" ValueChanged="Scale_ValueChanged" Margin="50,0,30,0"/>
|
||||
<TextBlock Grid.Row="7" Text="Camera Position" HorizontalAlignment="Left" FontSize="20" FontFamily="Segeo UI" Foreground="White"/>
|
||||
<Label Grid.Row="8" Content="_Radius" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="12" FontFamily="Segeo UI" Foreground="White" Target="{Binding ElementName=RadiusSlider}"/>
|
||||
<Slider Grid.Row="8" x:Name="RadiusSlider" Style="{StaticResource KinectSlider}" ValueChanged="Radius_ValueChanged" Minimum=".1" Value="2" Maximum="5" Margin="50,0,30,0" DataContext="{Binding}" />
|
||||
<Label Grid.Row="10" Content="_Theta" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="12" FontFamily="Segeo UI" Foreground="White" Target="{Binding ElementName=ThetaSlider}"/>
|
||||
<Slider Grid.Row="10" x:Name="ThetaSlider" Style="{StaticResource KinectSlider}" ValueChanged="Theta_ValueChanged" Minimum="-180" Maximum="180" Value="0" Margin="50,0,30,0"/>
|
||||
<Label Grid.Row="12" Content="_Phi" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="12" FontFamily="Segeo UI" Foreground="White" Target="{Binding ElementName=PhiSlider}"/>
|
||||
<Slider Grid.Row="12" x:Name="PhiSlider" Style="{StaticResource KinectSlider}" ValueChanged="Phi_ValueChanged" Minimum="-89.9" Maximum="89.9" Value="0" Margin="50,0,30,0"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<TextBlock Text="WPF D3D11 Interop" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,0,17" FontSize="14" Foreground="{StaticResource MediumGreyBrush}" FontFamily="Segoe UI"/>
|
||||
</Grid>
|
||||
</Window>
|
|
@ -0,0 +1,354 @@
|
|||
namespace Microsoft.Samples.Wpf.D3D11Interop
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Media;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
// Magnifier Image Settings
|
||||
private const double MagImageScale = 1.25; // Scale of image to magnified ellipse
|
||||
private const double MagImageOffset = 0.12; // Offset of magnified ellipse within image
|
||||
|
||||
// Unit conversion
|
||||
private const float DegreesToRadians = (float)Math.PI / 180;
|
||||
|
||||
// State Management
|
||||
private bool magnify = true;
|
||||
TimeSpan lastRender;
|
||||
bool lastVisible;
|
||||
|
||||
// Magnifier Settings (filled by default slider vlaues)
|
||||
private double magSize;
|
||||
private double magScale;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.host.Loaded += new RoutedEventHandler(this.Host_Loaded);
|
||||
this.host.SizeChanged += new SizeChangedEventHandler(this.Host_SizeChanged);
|
||||
}
|
||||
|
||||
private static bool Init()
|
||||
{
|
||||
|
||||
bool initSucceeded = NativeMethods.InvokeWithDllProtection(() => NativeMethods.Init()) >= 0;
|
||||
|
||||
if (!initSucceeded)
|
||||
{
|
||||
MessageBox.Show("Failed to initialize.", "WPF D3D Interop", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
|
||||
if (Application.Current != null)
|
||||
{
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
return initSucceeded;
|
||||
}
|
||||
|
||||
private static void Cleanup()
|
||||
{
|
||||
NativeMethods.InvokeWithDllProtection(NativeMethods.Cleanup);
|
||||
}
|
||||
|
||||
private static int Render(IntPtr resourcePointer)
|
||||
{
|
||||
return NativeMethods.InvokeWithDllProtection(() => NativeMethods.Render(resourcePointer));
|
||||
}
|
||||
|
||||
private static int SetCameraRadius(float radius)
|
||||
{
|
||||
return NativeMethods.InvokeWithDllProtection(() => NativeMethods.SetCameraRadius(radius));
|
||||
}
|
||||
|
||||
private static int SetCameraTheta(float theta)
|
||||
{
|
||||
return NativeMethods.InvokeWithDllProtection(() => NativeMethods.SetCameraTheta(theta));
|
||||
}
|
||||
|
||||
private static int SetCameraPhi(float phi)
|
||||
{
|
||||
return NativeMethods.InvokeWithDllProtection(() => NativeMethods.SetCameraPhi(phi));
|
||||
}
|
||||
|
||||
#region Callbacks
|
||||
private void Host_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Init();
|
||||
this.InitializeRendering();
|
||||
|
||||
// Setup the Magnifier Size
|
||||
MagEllipse.Height = this.magSize;
|
||||
MagEllipse.Width = this.magSize;
|
||||
Scale.Value = this.magScale;
|
||||
|
||||
// Add mouse over event
|
||||
host.MouseMove += this.MagElement_MouseMove;
|
||||
ImageHost.MouseMove += this.MagElement_MouseMove;
|
||||
MagEllipse.MouseMove += this.MagElement_MouseMove;
|
||||
MagImage.MouseMove += this.MagElement_MouseMove;
|
||||
|
||||
host.MouseLeave += this.MagElement_MouseLeave;
|
||||
MagEllipse.MouseLeave += this.MagElement_MouseLeave;
|
||||
ImageHost.MouseLeave += this.MagElement_MouseLeave;
|
||||
MagImage.MouseLeave += this.MagElement_MouseLeave;
|
||||
|
||||
MagBox.Checked += this.MagBox_Checked;
|
||||
MagBox.Unchecked += this.MagBox_Unchecked;
|
||||
}
|
||||
|
||||
private void Host_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||
{
|
||||
// TODO: handle non-96 DPI
|
||||
int surfWidth = (int)(host.ActualWidth < 0 ? 0 : Math.Ceiling(host.ActualWidth));
|
||||
int surfHeight = (int)(host.ActualHeight < 0 ? 0 : Math.Ceiling(host.ActualHeight));
|
||||
|
||||
InteropImage.SetPixelSize(surfWidth, surfHeight);
|
||||
NativeMethods.SetRenderSize(surfWidth, surfHeight);
|
||||
|
||||
// Stop rendering if the D3DImage isn't visible - currently just if width or height is 0
|
||||
// TODO: more optimizations possible (scrolled off screen, etc...)
|
||||
bool isVisible = (surfWidth != 0 && surfHeight != 0);
|
||||
if (lastVisible != isVisible)
|
||||
{
|
||||
lastVisible = isVisible;
|
||||
if (lastVisible)
|
||||
{
|
||||
CompositionTarget.Rendering += CompositionTarget_Rendering;
|
||||
}
|
||||
else
|
||||
{
|
||||
CompositionTarget.Rendering -= CompositionTarget_Rendering;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Scale_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
this.magScale = e.NewValue;
|
||||
}
|
||||
|
||||
private void Size_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
this.magSize = e.NewValue;
|
||||
|
||||
// Setup the Magnifier Size
|
||||
this.MagEllipse.Height = this.magSize;
|
||||
this.MagEllipse.Width = this.magSize;
|
||||
}
|
||||
|
||||
private void MagBox_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.magnify = true;
|
||||
|
||||
MagCurserToggle1.Cursor = System.Windows.Input.Cursors.None;
|
||||
MagCurserToggle2.Cursor = System.Windows.Input.Cursors.None;
|
||||
host.Cursor = System.Windows.Input.Cursors.None;
|
||||
}
|
||||
|
||||
private void MagBox_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.magnify = false;
|
||||
|
||||
MagCurserToggle1.Cursor = System.Windows.Input.Cursors.Arrow;
|
||||
MagCurserToggle2.Cursor = System.Windows.Input.Cursors.Arrow;
|
||||
host.Cursor = System.Windows.Input.Cursors.Arrow;
|
||||
}
|
||||
|
||||
private void MagElement_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (this.magnify)
|
||||
{
|
||||
Point point = Mouse.GetPosition(host);
|
||||
|
||||
if (!(point.X < 0 || point.Y < 0 || point.X > host.ActualWidth || point.Y > host.ActualHeight))
|
||||
{
|
||||
// Draw the Magnified ellipse on top of image
|
||||
System.Windows.Controls.Canvas.SetTop(this.MagEllipse, point.Y - (this.magSize / 2));
|
||||
System.Windows.Controls.Canvas.SetLeft(this.MagEllipse, point.X - (this.magSize / 2));
|
||||
|
||||
// Set the magnifier image on top of magnified ellipse
|
||||
System.Windows.Controls.Canvas.SetTop(this.MagImage, point.Y - (this.magSize * (.5 + MagImageOffset)));
|
||||
System.Windows.Controls.Canvas.SetLeft(this.MagImage, point.X - (this.magSize * (.5 + MagImageOffset)));
|
||||
MagImage.Width = this.magSize * MagImageScale;
|
||||
|
||||
MagEllipse.Visibility = System.Windows.Visibility.Visible;
|
||||
MagImage.Visibility = System.Windows.Visibility.Visible;
|
||||
|
||||
double magViewboxSize = this.magSize / this.magScale;
|
||||
MagBrush.Viewbox = new Rect(point.X - (.5 * magViewboxSize), point.Y - (.5 * magViewboxSize), magViewboxSize, magViewboxSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
MagEllipse.Visibility = Visibility.Hidden;
|
||||
MagImage.Visibility = Visibility.Hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void MagElement_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
MagEllipse.Visibility = Visibility.Hidden;
|
||||
MagImage.Visibility = Visibility.Hidden;
|
||||
}
|
||||
|
||||
private void Radius_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
SetCameraRadius((float)e.NewValue);
|
||||
}
|
||||
|
||||
private void Theta_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
SetCameraTheta((float)e.NewValue * DegreesToRadians);
|
||||
}
|
||||
|
||||
private void Phi_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
SetCameraPhi((float)e.NewValue * DegreesToRadians);
|
||||
}
|
||||
#endregion Callbacks
|
||||
|
||||
#region Helpers
|
||||
private void InitializeRendering()
|
||||
{
|
||||
InteropImage.WindowOwner = (new System.Windows.Interop.WindowInteropHelper(this)).Handle;
|
||||
InteropImage.OnRender = this.DoRender;
|
||||
|
||||
// Set up camera
|
||||
SetCameraRadius((float)RadiusSlider.Value);
|
||||
SetCameraPhi((float)PhiSlider.Value * DegreesToRadians);
|
||||
SetCameraTheta((float)ThetaSlider.Value * DegreesToRadians);
|
||||
|
||||
// Start rendering now!
|
||||
InteropImage.RequestRender();
|
||||
}
|
||||
|
||||
void CompositionTarget_Rendering(object sender, EventArgs e)
|
||||
{
|
||||
RenderingEventArgs args = (RenderingEventArgs)e;
|
||||
|
||||
// It's possible for Rendering to call back twice in the same frame
|
||||
// so only render when we haven't already rendered in this frame.
|
||||
if (this.lastRender != args.RenderingTime)
|
||||
{
|
||||
InteropImage.RequestRender();
|
||||
this.lastRender = args.RenderingTime;
|
||||
}
|
||||
}
|
||||
|
||||
private void UninitializeRendering()
|
||||
{
|
||||
Cleanup();
|
||||
|
||||
CompositionTarget.Rendering -= this.CompositionTarget_Rendering;
|
||||
}
|
||||
#endregion Helpers
|
||||
|
||||
private void DoRender(IntPtr surface)
|
||||
{
|
||||
Render(surface);
|
||||
}
|
||||
|
||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
this.UninitializeRendering();
|
||||
|
||||
host.MouseMove -= this.MagElement_MouseMove;
|
||||
ImageHost.MouseMove -= this.MagElement_MouseMove;
|
||||
MagEllipse.MouseMove -= this.MagElement_MouseMove;
|
||||
MagImage.MouseMove -= this.MagElement_MouseMove;
|
||||
|
||||
host.MouseLeave -= this.MagElement_MouseLeave;
|
||||
MagEllipse.MouseLeave -= this.MagElement_MouseLeave;
|
||||
ImageHost.MouseLeave -= this.MagElement_MouseLeave;
|
||||
MagImage.MouseLeave -= this.MagElement_MouseLeave;
|
||||
|
||||
MagBox.Checked -= this.MagBox_Checked;
|
||||
MagBox.Unchecked -= this.MagBox_Unchecked;
|
||||
}
|
||||
|
||||
private static class NativeMethods
|
||||
{
|
||||
/// <summary>
|
||||
/// Variable used to track whether the missing dependency dialog has been displayed,
|
||||
/// used to prevent multiple notifications of the same failure.
|
||||
/// </summary>
|
||||
private static bool errorHasDisplayed;
|
||||
|
||||
[DllImport("D3DVisualization.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Init();
|
||||
|
||||
[DllImport("D3DVisualization.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Cleanup();
|
||||
|
||||
[DllImport("D3DVisualization.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int Render(IntPtr resourcePointer);
|
||||
|
||||
[DllImport("D3DVisualization.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SetCameraRadius(float radius);
|
||||
|
||||
[DllImport("D3DVisualization.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SetCameraTheta(float theta);
|
||||
|
||||
[DllImport("D3DVisualization.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SetCameraPhi(float phi);
|
||||
|
||||
[DllImport("D3DVisualization.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SetRenderSize(int pixelWidth, int pixelHeight);
|
||||
|
||||
/// <summary>
|
||||
/// Method used to invoke an Action that will catch DllNotFoundExceptions and display a warning dialog.
|
||||
/// </summary>
|
||||
/// <param name="action">The Action to invoke.</param>
|
||||
public static void InvokeWithDllProtection(Action action)
|
||||
{
|
||||
InvokeWithDllProtection(
|
||||
() =>
|
||||
{
|
||||
action.Invoke();
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method used to invoke A Func that will catch DllNotFoundExceptions and display a warning dialog.
|
||||
/// </summary>
|
||||
/// <param name="func">The Func to invoke.</param>
|
||||
/// <returns>The return value of func, or default(T) if a DllNotFoundException was caught.</returns>
|
||||
/// <typeparam name="T">The return type of the func.</typeparam>
|
||||
public static T InvokeWithDllProtection<T>(Func<T> func)
|
||||
{
|
||||
try
|
||||
{
|
||||
return func.Invoke();
|
||||
}
|
||||
catch (DllNotFoundException e)
|
||||
{
|
||||
if (!errorHasDisplayed)
|
||||
{
|
||||
MessageBox.Show("This sample requires:\nManual build of the D3DVisualization project, which requires DirectX SDK Installation.\n" +
|
||||
"Installation of the DirectX runtime on non-build machines.\n\n"+
|
||||
"Detailed exception message: " + e.Message, "WPF D3D11 Interop",
|
||||
MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
errorHasDisplayed = true;
|
||||
|
||||
if (Application.Current != null)
|
||||
{
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return default(T);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Wpf D3D11 Interop Sample")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// In order to begin building localizable applications, set
|
||||
// <UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||
// inside a <PropertyGroup>. For example, if you are using US english
|
||||
// in your source files, set the <UICulture> to en-US. Then uncomment
|
||||
// the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||
// the line below to match the UICulture setting in the project file.
|
||||
|
||||
////[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, // where theme specific resource dictionaries are located
|
||||
// (used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly // where the generic resource dictionary is located
|
||||
// (used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
|
||||
[assembly: NeutralResourcesLanguageAttribute("en-US")]
|
||||
[assembly: CLSCompliant(true)]
|
|
@ -0,0 +1,63 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Microsoft.Samples.Wpf.D3D11Interop.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("D3D11ImageSample.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Microsoft.Samples.Wpf.D3D11Interop.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
|
@ -0,0 +1,132 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{19855A82-A7EC-4E95-B0C4-B1A2356732B7}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.Samples.Wpf.D3D11Interop</RootNamespace>
|
||||
<AssemblyName>WpfD3D11Interop</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>
|
||||
</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|Win32'">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<OutputPath>..\x86\Debug\</OutputPath>
|
||||
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|Win32'">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<OutputPath>..\x86\Release\</OutputPath>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<OutputPath>..\x64\Debug\</OutputPath>
|
||||
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<OutputPath>..\x64\Release\</OutputPath>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.SurfaceQueueInteropHelper, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=x64">
|
||||
<HintPath>packages\Microsoft.Wpf.Interop.D3D11Image-x64.0.9.0-alpha-22848\lib\net45\Microsoft.SurfaceQueueInteropHelper.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Wpf.Interop.D3D11Image, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Microsoft.Wpf.Interop.D3D11Image-x64.0.9.0-alpha-22848\lib\net45\Microsoft.Wpf.Interop.D3D11Image.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Images\Checkbox_checked.png" />
|
||||
<Resource Include="Images\Checkbox_unchecked.png" />
|
||||
<Resource Include="Images\MagnifyingGlass.PNG" />
|
||||
<Resource Include="Images\background.jpg" />
|
||||
<Resource Include="Images\radiobutton_off.png" />
|
||||
<Resource Include="Images\radiobutton_on.png" />
|
||||
<Resource Include="Images\Slider.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Wpf.Interop.D3D11Image-x64" version="0.9.0-alpha-22848" targetFramework="net45" />
|
||||
</packages>
|
|
@ -0,0 +1,46 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.23107.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfD3D11Interop", "WpfD3D11Interop\WpfD3D11Interop.csproj", "{19855A82-A7EC-4E95-B0C4-B1A2356732B7}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "D3DVisualization_dxsdk", "D3D11Visualization\D3DVisualization_dxsdk.vcxproj", "{3FEB553A-62BD-42E1-9A70-0CD3E45929D0}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{19855A82-A7EC-4E95-B0C4-B1A2356732B7}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{19855A82-A7EC-4E95-B0C4-B1A2356732B7}.Debug|x64.Build.0 = Debug|x64
|
||||
{19855A82-A7EC-4E95-B0C4-B1A2356732B7}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{19855A82-A7EC-4E95-B0C4-B1A2356732B7}.Debug|x86.Build.0 = Debug|Win32
|
||||
{19855A82-A7EC-4E95-B0C4-B1A2356732B7}.Release|x64.ActiveCfg = Release|x64
|
||||
{19855A82-A7EC-4E95-B0C4-B1A2356732B7}.Release|x64.Build.0 = Release|x64
|
||||
{19855A82-A7EC-4E95-B0C4-B1A2356732B7}.Release|x86.ActiveCfg = Release|Win32
|
||||
{19855A82-A7EC-4E95-B0C4-B1A2356732B7}.Release|x86.Build.0 = Release|Win32
|
||||
{3FEB553A-62BD-42E1-9A70-0CD3E45929D0}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{3FEB553A-62BD-42E1-9A70-0CD3E45929D0}.Debug|x64.Build.0 = Debug|x64
|
||||
{3FEB553A-62BD-42E1-9A70-0CD3E45929D0}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{3FEB553A-62BD-42E1-9A70-0CD3E45929D0}.Debug|x86.Build.0 = Debug|Win32
|
||||
{3FEB553A-62BD-42E1-9A70-0CD3E45929D0}.Release|x64.ActiveCfg = Release|x64
|
||||
{3FEB553A-62BD-42E1-9A70-0CD3E45929D0}.Release|x64.Build.0 = Release|x64
|
||||
{3FEB553A-62BD-42E1-9A70-0CD3E45929D0}.Release|x86.ActiveCfg = Release|Win32
|
||||
{3FEB553A-62BD-42E1-9A70-0CD3E45929D0}.Release|x86.Build.0 = Release|Win32
|
||||
{D73DCE48-0DBC-40FE-AC89-2C06AF01060B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D73DCE48-0DBC-40FE-AC89-2C06AF01060B}.Debug|x64.Build.0 = Debug|x64
|
||||
{D73DCE48-0DBC-40FE-AC89-2C06AF01060B}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{D73DCE48-0DBC-40FE-AC89-2C06AF01060B}.Debug|x86.Build.0 = Debug|Win32
|
||||
{D73DCE48-0DBC-40FE-AC89-2C06AF01060B}.Release|x64.ActiveCfg = Release|x64
|
||||
{D73DCE48-0DBC-40FE-AC89-2C06AF01060B}.Release|x64.Build.0 = Release|x64
|
||||
{D73DCE48-0DBC-40FE-AC89-2C06AF01060B}.Release|x86.ActiveCfg = Release|Win32
|
||||
{D73DCE48-0DBC-40FE-AC89-2C06AF01060B}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,46 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.23107.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfD3D11Interop", "WpfD3D11Interop\WpfD3D11Interop.csproj", "{19855A82-A7EC-4E95-B0C4-B1A2356732B7}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "D3DVisualization_winsdk", "D3D11Visualization\D3DVisualization_winsdk.vcxproj", "{D73DCE48-0DBC-40FE-AC89-2C06AF01060B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{19855A82-A7EC-4E95-B0C4-B1A2356732B7}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{19855A82-A7EC-4E95-B0C4-B1A2356732B7}.Debug|x64.Build.0 = Debug|x64
|
||||
{19855A82-A7EC-4E95-B0C4-B1A2356732B7}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{19855A82-A7EC-4E95-B0C4-B1A2356732B7}.Debug|x86.Build.0 = Debug|Win32
|
||||
{19855A82-A7EC-4E95-B0C4-B1A2356732B7}.Release|x64.ActiveCfg = Release|x64
|
||||
{19855A82-A7EC-4E95-B0C4-B1A2356732B7}.Release|x64.Build.0 = Release|x64
|
||||
{19855A82-A7EC-4E95-B0C4-B1A2356732B7}.Release|x86.ActiveCfg = Release|Win32
|
||||
{19855A82-A7EC-4E95-B0C4-B1A2356732B7}.Release|x86.Build.0 = Release|Win32
|
||||
{3FEB553A-62BD-42E1-9A70-0CD3E45929D0}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{3FEB553A-62BD-42E1-9A70-0CD3E45929D0}.Debug|x64.Build.0 = Debug|x64
|
||||
{3FEB553A-62BD-42E1-9A70-0CD3E45929D0}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{3FEB553A-62BD-42E1-9A70-0CD3E45929D0}.Debug|x86.Build.0 = Debug|Win32
|
||||
{3FEB553A-62BD-42E1-9A70-0CD3E45929D0}.Release|x64.ActiveCfg = Release|x64
|
||||
{3FEB553A-62BD-42E1-9A70-0CD3E45929D0}.Release|x64.Build.0 = Release|x64
|
||||
{3FEB553A-62BD-42E1-9A70-0CD3E45929D0}.Release|x86.ActiveCfg = Release|Win32
|
||||
{3FEB553A-62BD-42E1-9A70-0CD3E45929D0}.Release|x86.Build.0 = Release|Win32
|
||||
{D73DCE48-0DBC-40FE-AC89-2C06AF01060B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D73DCE48-0DBC-40FE-AC89-2C06AF01060B}.Debug|x64.Build.0 = Debug|x64
|
||||
{D73DCE48-0DBC-40FE-AC89-2C06AF01060B}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{D73DCE48-0DBC-40FE-AC89-2C06AF01060B}.Debug|x86.Build.0 = Debug|Win32
|
||||
{D73DCE48-0DBC-40FE-AC89-2C06AF01060B}.Release|x64.ActiveCfg = Release|x64
|
||||
{D73DCE48-0DBC-40FE-AC89-2C06AF01060B}.Release|x64.Build.0 = Release|x64
|
||||
{D73DCE48-0DBC-40FE-AC89-2C06AF01060B}.Release|x86.ActiveCfg = Release|Win32
|
||||
{D73DCE48-0DBC-40FE-AC89-2C06AF01060B}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|