AFAIK WPF Canvas requires that the children of the user interface are positioned using absolute coordinates. To achieve the “right shot” effect, I think you need to handle the window resize event, recalculate and apply the “Up”, “Left” coordinates for the “Image” child element, to always adhere to the right corner of the sleeve.
<Window x:Class="HelloWPF.Window1" xmlns... Title="Window1" Height="300" Width="339"> <Canvas> <Image Canvas.Left="195" Canvas.Top="175" Height="87" Name="image1" Stretch="Fill" Width="122" Source="dilbert2666700071126ni1.gif"/> </Canvas> </Window>
Gishu
source share