维克斯无法正确渲染图像 [英] WiX not rendering images correctly

查看:139
本文介绍了维克斯无法正确渲染图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写一个定制的WiX的对话框,作为其工作流程的一部分,显示了在响应某些条件下的错误形象。然而,维克斯似乎无视我的尺寸和显示,因为它感觉合适。这里是我的code:

I'm trying to write a custom WiX dialog which, as part of its workflow, shows an error image in response to certain conditions. However, WiX appears to be ignoring my dimensions and displaying as it feels fit. Here's my code:

<Binary Id="WixUI_FailureImg" SourceFile="$(sys.SOURCEFILEDIR)..\Resources\Failure.ico" />
<Control Id="TestResult_Failure" Type="Icon" IconSize="16" X="15" Y="206" Width="16" Height="16" Text="WixUI_FailureImg">
    <Condition Action="hide">LOGON_VALID = "1"</Condition>
    <Condition Action="show">LOGON_VALID = "0"</Condition>
</Control>

我已经包括下面的对话框中的一个片段,在后台原始图像(16×16 .ICO)。正如你所看到的图像已被向上缩放,并有图像周围没有透明度。我试过8位和24位的位图以及图标,但它们都产生相同的结果。有什么是我做的显然是错误的?

I've included a snippet of the resulting dialog below, with the original image (a 16x16 .ico) in the background. As you can see, the image has been scaled upwards, and there is no transparency around the image. I've tried 8-bit and 24-bit bitmaps as well icons, but they all produce the same result. Is there something that I am doing obviously wrong?

更新:

如果你想知道如何动态影像作品,这里的相关部分:

In case you were wondering how the dynamic images works, here's the relevant section:

<Control Id="TestResult_Success" Type="Icon" IconSize="16" X="15" Y="210" Width="12" Height="12" Text="WixUI_SuccessImg">
    <Condition Action="hide">LOGON_VALID = "0"</Condition>
    <Condition Action="show">LOGON_VALID = "1"</Condition>
</Control>
<Control Id="TestPrompt_Success" Type="Text" X="35" Y="210" Width="322" Height="10" Text="!(loc.SqlSelectDlgConnectionValid)">
    <Condition Action="hide">LOGON_VALID = "0"</Condition>
    <Condition Action="show">LOGON_VALID = "1"</Condition>
</Control>
<Control Id="TestResult_Failure" Type="Icon" IconSize="16" X="15" Y="210" Width="12" Height="12" Text="WixUI_FailureImg">
    <Condition Action="hide">LOGON_VALID = "1"</Condition>
    <Condition Action="show">LOGON_VALID = "0"</Condition>
</Control>
<Control Id="TestPrompt_Failure" Type="Text" X="35" Y="210" Width="322" Height="10" Text="!(loc.SqlSelectDlgConnectionInvalid)">
    <Condition Action="hide">LOGON_VALID = "1"</Condition>
    <Condition Action="show">LOGON_VALID = "0"</Condition>
</Control>

正如你从截图中可以猜测,该页面是有关建立SQL连接;我有一个创建一个基于用户的输入连接字符串,并试图验证它自定义操作。如果它是有效的( LOGON_VALID =1),我得到一个勾图片和一些文字说什么都好,否则我得到一个警告图标和一些文字,以警告用户。当然,下一步按钮也被此值控制。

As you can guess from the screenshot, the page is related to establishing a SQL connection; I have a custom action that creates a connection string based on the user's input, and attempts to validate it. If it's valid (LOGON_VALID = "1"), I get a tick image and some text to say everything is good, otherwise I get a warning icon and some text to warn the user. Of course, the Next button is also controlled by this value.

推荐答案

X,Y,宽度和高度。变换安装单位像素取决于视觉主题,字体大小和DPI设置。最好的办法就是让它好看默认设置。

X, Y, Width, and Height are in "installer units," not pixels. Converting installer units to pixels depends on the visual theme, font size, and DPI settings. Your best bet is to make it look good on default settings.

这篇关于维克斯无法正确渲染图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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