I have added added an image to my layout,contained in a Viewbox but when I run the application the image KinectVideo
doesn't show on screen.
Is there a property I'm missing in the layout orshould I rearrange the image in the layout to make it visible again?
This is how I have defined the layout:
<Window x:Class="BVversion1.ConditioningFrm"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="ConStackPanelditioningFrm" Height="377.612" Width="637.313">
<Viewbox Stretch="Uniform" HorizontalAlignment="Center">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Button x:Name="pushUpBtn" Content="Push Ups" Width="100" Click="pushUpBtn_Click"/>
<Button x:Name="burpeeBtn" Content="Burpee" Width="100" Click="burpeeBtn_Click"/>
<Button x:Name="squatBtn" Content="Squat" Width="100" Click="squatBtn_Click"/>
<Button x:Name="coreBtn" Content="Core" Width="100" Click="coreBtn_Click"/>
</StackPanel>
<Image x:Name="KinectVideo" Width="640" Height="250" Visibility="Visible"/>
<Button x:Name="homeBtn" Content="Home" Width="75" Click="homeBtn_Click"/>
</StackPanel>
</Viewbox>
</Window>
Setting image source to bitmap:
KinectVideo.Source = BitmapSource.Create(colorFrame.Width, colorFrame.Height, 96, 96,
PixelFormats.Bgr32, null, colorData, colorFrame.Width * colorFrame.BytesPerPixel)
I did a test with KinectVideo.Source = new BitmapImage(new Uri("http://www.gravatar.com/avatar/ccac9a107581b343e832a2b040278b98?s=128&d=identicon&r=PG", UriKind.RelativeOrAbsolute)); since we do not have your colorData and it works for me pretty fine.