UWP应用程序不发送图像

时间:2018-03-11 13:53:13

标签: c# image uwp

UWP应用程序不显示图像,所以我没有。 这是我的代码

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Pivot>
            <PivotItem Header="Write">
                <ScrollViewer>
                    <StackPanel Loaded="WriteStackPanel_Loaded" Orientation="Vertical">
                        <TextBlock
                            x:Name="WriteText_1"
                            Margin="0,10,0,0"
                            Text="text 1"
                            TextWrapping="Wrap" />
                        <TextBlock
                            x:Name="WriteText_2"
                            Margin="0,10,0,0"
                            Text="text 2"
                            TextWrapping="Wrap" />
                        <Grid Height="70" Margin="0,10,0,0">
                            <Image Stretch="Uniform" Source="Assets\AppData\About\Checks\write_image_1.png" />
                        </Grid>
                    </StackPanel>
                </ScrollViewer>
            </PivotItem>
        </Pivot>
    </Grid>

我也做了以下事情 1)构建动作设置为内容。

2)并尝试将** copy设置为输出目录&#34;在您的图像属性中。 正如所说here。 它不在应用程序中,但在Visual Studio的构造函数中,一切都在那里。 Screen folder Assets

1 个答案:

答案 0 :(得分:1)

我查看了Assets文件夹的屏幕截图,确实Private Sub PictureBox1_Paint(sender As Object, e As PaintEventArgs) Handles PictureBox1.Paint Using TextBrush As SolidBrush = New SolidBrush(Me.ForeColor) e.Graphics.DrawString("BITS Registration ID", Me.Font, TextBrush, New Point(5, 5)) End Using End Sub 文件夹中没有write_image_1.png图片,只有Assets\AppData\About\Checks个文件。

如果图像位于此文件夹中(在文件资源管理器中),则可能不包含该图像。单击解决方案资源管理器顶部工具栏中的显示所有文件按钮以显示所有文件。然后右键单击图像文件并选择包含在项目中