【问题标题】:Image Brush Not working windows phone 8.1图像刷不工作 windows phone 8.1
【发布时间】:2016-01-28 13:48:13
【问题描述】:

我的 xaml 代码

   <Grid Background="White">
    <StackPanel Height="580" Margin="0,0,0,50" Orientation="Vertical">
        <Image Height="70" Width="100" HorizontalAlignment="Center"/>
        <Image Height="50" Width="300" HorizontalAlignment="Center"/>
        <Ellipse x:Name="imgProfile" Height="180" Width="180"  Visibility="Visible"  >
            <Ellipse.Fill>
                <ImageBrush ImageSource="/IOB Wallet/Images/Profile/photo.png" Stretch="UniformToFill" />
            </Ellipse.Fill>
        </Ellipse>
        <TextBlock Height="40" Text="Welcome Back !!!" Foreground="#06419D" FontSize="30" FontWeight="SemiBold" TextAlignment="Center" Margin="4"/>
        <TextBlock Height="40" Text="" Foreground="Black" FontSize="28" FontWeight="SemiBold" TextAlignment="Center" Margin="4"/>
        <TextBlock Height="30" Text="" Foreground="Black" FontSize="24" FontWeight="Normal" TextAlignment="Center" Margin="4"/>
        <StackPanel Orientation="Horizontal">
            <TextBlock Text="If you are Not ?" Foreground="Black" FontSize="15" HorizontalAlignment="Center" Margin="75,10,0,0"/>
            <HyperlinkButton Content="Change User" Foreground="#06419D" FontSize="20" Margin="20,0,0,0"/>
        </StackPanel>
        <PasswordBox Height="40" PlaceholderText=" Password"  BorderThickness="0 0 0 1" BorderBrush="#06419D" Margin="4,0,2,0"/>
        <HyperlinkButton Foreground="#06419D" FontWeight="Light" Visibility="Visible" Content="Forgot Your Password ?" FontSize="20" HorizontalAlignment="Right" Width="234" />

    </StackPanel>
    <Button Content="LOGIN" Name="btnGetstarted" FontSize="26" FontWeight="Light" VerticalAlignment="Bottom" Foreground="White" Margin="1,0,0,-8" BorderThickness="0" Background="#06419D" Height="56" Width="500" Click="btnLogin_Click"  />

图像在 Xaml 设计视图中可见。运行/部署应用程序后,图像未显示。我的照片实际尺寸 100 * 100.. 请提出解决方案

【问题讨论】:

  • 尝试设置完整的图片路径:ms-appx:///Assets/IOB Wallet/Images/Profile/photo.png 或 ms-appx:///IOB Wallet/Images/Profile/photo .png 我不知道你的图片在哪里
  • 试过了。不工作..
  • 试试
  • 试过..不工作

标签: .net xaml windows-runtime windows-phone-8.1


【解决方案1】:
<Ellipse x:Name="imgProfile" Height="180" Width="180"  Visibility="Visible"  >
            <Ellipse.Fill>
                <ImageBrush ImageSource="ms-appx:///IOB Wallet/Images/Profile/photo.png"  />
            </Ellipse.Fill>
</Ellipse>

试试这个代码

【讨论】:

    【解决方案2】:

    您应该尝试通过属性窗口设置背景。单击 XAML 代码中的 Ellipse 标记内部,然后按 F4 键打开“属性”窗口。展开画笔项目并选择平铺画笔。通过下拉菜单选择ImageSource

    【讨论】:

    • 您是否检查了属性中的“构建操作”值?
    猜你喜欢
    • 1970-01-01
    • 2023-03-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多