Viewbox에 포함 된 이미지를 레이아웃에 추가했습니다.하지만 애플리케이션을 실행하면 이미지 KinectVideo
이 화면에 표시되지 않습니다.ViewBox에 포함 된 이미지를 표시하는 방법은 무엇입니까?
레이아웃에 누락 된 속성이 있습니까? 다시 볼 수 있도록 레이아웃에서 이미지를 재정렬해야합니까?
이 내가 레이아웃 정의하는 방법입니다 : 비트 맵
<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>
설정 이미지 소스 :
KinectVideo.Source = BitmapSource.Create(colorFrame.Width, colorFrame.Height, 96, 96,
PixelFormats.Bgr32, null, colorData, colorFrame.Width * colorFrame.BytesPerPixel)
여기서 '이미지'의 '소스'를 설정 했습니까? –
@Rohit 소스를 추가하는 방법을 보여주는 질문에 세부 사항을 추가했습니다.이 코드는 이미지가 뷰 박스의 요소 일 때만 작동하지만 버튼과 스택 패널을 추가 할 때 작동하지 않습니다. –