Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WiX not rendering images correctly

Tags:

bitmap

wix

wix3.5

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>

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?

example of borked image

UPDATE:

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>

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.

like image 627
David Keaveny Avatar asked Dec 02 '11 04:12

David Keaveny


People also ask

Why does Wix look different on different screens?

Also, note that your website will look on different devices and monitors due to the devices screen size and you can adjust the mobile device in the mobile editor too.

Do I need to compress images for Wix?

There is absolutely no need to compress or resize your image. Simply upload your photos. When displaying the picture on your visitors' browsers, this photography website feature will automatically determine the best resolution and apply it.


1 Answers

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.

like image 60
Bob Arnson Avatar answered Nov 18 '22 06:11

Bob Arnson