Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

image on design surface compressed ( new user quest easy ?)

$
0
0

I have an image and would like to be able represent the image as a narrower band. But when I push on it, the length also begins to shrink. If I reduce Height from "30" to "10" the width dynamically contracts.  I thought if I added a view box around the image maybe I could use that to narrow the image view ( narrowing view or simply contracting upward would be the same for this image.  What should I do ?

<Window x:Class="WpfImageWindowScreen.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="373" Width="525">
    <Grid ShowGridLines="True">

        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>

        </Grid.RowDefinitions >
        <Label Grid.Row =" 0" Grid.Column =" 0" Background =" Black" Foreground =" White" HorizontalContentAlignment =" Center" Grid.ColumnSpan="3" Content="My Title"/>
        <GroupBox Grid.Row ="1" Grid.Column =" 0" Background =" White" Header =" Image Bar Row" HorizontalAlignment="Right"  Width="517">
            <Viewbox StretchDirection="UpOnly" Height="50" VerticalAlignment="Center" >
                <Image Source ="{DynamicResource ImageSource1}"  Height="30" VerticalAlignment="Center"  HorizontalAlignment="Center"   Width="286"/>
            </Viewbox>
        </GroupBox>

    </Grid>
</Window>


andrew


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>