如何将图像添加到自定义WiX对话框? [英] How can I add an image to a custom WiX dialog?

查看:224
本文介绍了如何将图像添加到自定义WiX对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已尝试修改我的Product.wxs中的WixVariables集,如下所示:

I have tried modifying the set of WixVariables in my Product.wxs like so:

<WixVariable Id="MainLogoBmp" Value="Resources/Images/weblabel.jpg" />
<WixVariable Id="WixUIBannerBmp" Value="Resources/Images/installer_banner.jpg" />

(第一部分是我试过的,下面的一部分是股票变量的一个例子,工作)

(The first part is what I tried, the one below it is an example of the stock variable that works)

...然后用!(wix.MainLogoBmp)引用变量:

...and then referencing the variable with !(wix.MainLogoBmp):

<Control Id="Bitmap"
         Type="Bitmap"
         X="0"
         Y="0"
         Width="258"
         Height="185"
         TabSkip="no"
         Text="!(wix.MainLogoBmp)" />

...但是当我尝试编译时,我收到以下错误:

...but when I try to compile this I get the following error:

错误17 ICE17:位图:控件的'Resources / Images / weblabel.jpg':对话框的'位图':在二进制表中找不到'SimpleDlg'

Error 17 ICE17: Bitmap: 'Resources/Images/weblabel.jpg' for Control: 'Bitmap' of Dialog: 'SimpleDlg' not found in Binary table

是的,图像是项目的一部分,设置为内容,就像其他的一样。

And yes the image is part of the project, set to "Content" like the other ones.

推荐答案

<啊,啊哈,原来我需要在文件中添加一个 Binary 元素:

<Binary Id="MainImage" SourceFile="Resources/Images/weblabel.jpg" />

...并设置文本位图控制到MainImage:

...and to set the Text of the Bitmap Control to "MainImage":

            <Control Id="Bitmap"
                        Type="Bitmap"
                        X="0"
                        Y="0"
                        Width="258"
                        Height="185"
                        TabSkip="no"
                        Text="MainImage" />

现在可行。 :)

这篇关于如何将图像添加到自定义WiX对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆