March 25th, 2014, 07:01 AM
Image size inside a canvas control
I'm using VS 2010 Professional, Net 4.5.5...
I put a canvas in my window and I put an image in the canvas. I have the inage set to the canvas top and canvas left and I set the image with Height and Width Auto, VerticalAlignment and HorizontalAlignment = Stretch. MaxHeight and MaxWidth=Infinity.
When I run the program the image shows in the upper left corner and only covers about 1/3 of the area. Should I use something other than a canvas? I tried with just making the image the background of the window, but I couldn't figure out how to do that.
While the settings don't show up in the xaml I did set them in the Properties. I deleted the automatic en tries for height and width that appeared in the Image control above because they were set to fixed values.
<Style x:Key="TimeFormat" TargetType="Label">
<Setter Property="FontFamily" Value="Century" />
<Setter Property="FontSize" Value="10" />
<Canvas Name="MainCanvas" >
<Image Canvas.Left="0" Canvas.Top="0" Name="World"
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.