Wednesday, 14 August 2013

Image blocks out Canvas

Image blocks out Canvas

<Image Width="640" Height="480" Name="ImageControl" Grid.Column="0"
Grid.Row="1" />
<Canvas Width="620" Height="480" Name="myCanvas" Grid.Column="0"
Grid.Row="1" >
<Ellipse Width="10" Height="10" Fill="Red" Canvas.Left="610"
Canvas.Top="10" Name="Circle1" Canvas.ZIndex="99" />
<Ellipse Width="10" Height="10" Fill="Red" Canvas.Left="610"
Canvas.Top="30" Name="Circle2" />
<Ellipse Width="10" Height="10" Fill="Red" Canvas.Left="610"
Canvas.Top="50" Name="Circle3" />
<Ellipse Width="10" Height="10" Fill="Red" Canvas.Left="610"
Canvas.Top="70" Name="Circle4" />
<Ellipse Width="10" Height="10" Fill="Red" Canvas.Left="610"
Canvas.Top="90" Name="Circle5" />
<Ellipse Width="10" Height="10" Fill="Red" Canvas.Left="610"
Canvas.Top="110" Name="Circle6" />
<Ellipse Width="10" Height="10" Fill="Red" Canvas.Left="610"
Canvas.Top="130" Name="Circle7" />
<Ellipse Width="10" Height="10" Fill="Red" Canvas.Left="610"
Canvas.Top="150" Name="Circle8" />
</Canvas>
I have an Image and a Canvas in the same cell in a Grid. The idea is to
place the 8 red ellipses over the image. The Image currently has no source
as the Kinect is used to supply the image. When it first loads the red
ellipses can be seen for a split second until the image loads and then
they aren't seen again.
I have tried changed the order of the elements, the ZIndex of the Canvas,
the ZIndex of the Grid all with no avail.
this.ImageControl.Source = BitmapSource.Create(
imageFrame.Width,
imageFrame.Height,
96,
96,
PixelFormats.Bgr32,
null,
this.pixelData,
stride);
This is how the Kinect stream image is assigned to the Image source.

No comments:

Post a Comment