Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to have a full window background image in a burn theme?

Tags:

wix

burn

When I set an Image to fill the window, it seems to render over the top of the other controls and generally make a mess of painting the window. The order in the file doesn't seem to help, however if I put it inside it's own Page section it behaves a little better.

Is there any way to display an image behind everything in the window?

Also, the other controls don't seem to render over the top of it properly when they do (text has white background, buttons have white squares), I'm guessing they need a transparent mode set somewhere?


Edit:

Here is an example of the problem, the button and checkbox became visible from mouseover, and the text from selecting:

problem image

like image 483
redwyre Avatar asked Apr 04 '13 05:04

redwyre


People also ask

How do I make the background of an image transparent?

Go to Select > Invert. On the right side of the screen, right-click on your image and select Add Alpha Channel. This will provide a transparent background.


3 Answers

I was not able to get the Image as a background to work, however I was able to get what I wanted using the window background.

The Window allows you to use an image specified in the Theme/@ImageFile, and then specify the Window/@SourceX and Window/@SourceY offsets to 0. However this is not enough, as the Windows referenced font background will override the window image background. You need to use a font without a background specified.

<Theme xmlns="http://wixtoolset.org/schemas/thmutil/2010"
    ImageFile="background.png">
    <Window Width="485" Height="300" HexStyle="100a0000"
        FontId="0" SourceX="0" SourceY="0">#(loc.Caption)</Window>
    <Font Id="0" Height="-12" Weight="500"
        Foreground="000000" Background="FFFFFF">Segoe UI</Font>

There are two other issues I had to work around:

  • The checkboxes dont obey the background colour but that's because of the common controls wixstdba uses, just have to deal with it.
  • The progress text changes but doesn't have its background repainted, so it draws over itself, worked around by giving it a background.

dialog with background image

like image 119
redwyre Avatar answered Jan 12 '23 12:01

redwyre


Yes, it is possible. If you have a static image that is the same for all pages in the theme then you can put the Image element above all the page elements. Optionally, if you want a different background per-page then put the image first in the page. I organize my theme like so:

<Theme>
   <Window />
   <Font /> <!-- as many as necessary -->

   <Image /> <!-- global background image -->

   <Page> <!-- repeat for each page -->
      <Image /> <!-- per-page background image -->
      <other controls />

The order of the control elements defines the Z-order in reverse. The first control is on bottom and the controls down from there stack on top. That's why the background Image needs to be first.

As for transparent text, it is possible with varying levels of goodness. First to get rid of the white background, you need to remove the Background attribute from the Font element used for the transparent text. An absent Background attribute means use the null brush for the text, which is essentially transparent.

The levels of transparency goodness depends on the control. Checkboxes never seem to respect the transparent text. Also, transparent text does not work well if it gets redrawn. You'll see the old text left behind. So transparency only works on Text that isn't updated.

Anyway, hopefully the above gets you started. If you'd like to contribute to help improve transparency or theme's I recommend taking a look at the code in src\dutil\thmutil.cpp. Maybe you can us figure out how to make it work perfectly.

like image 36
Rob Mensching Avatar answered Jan 12 '23 13:01

Rob Mensching


I've just found out a key field when attempting to theme WIX.

Visible="yes"

Does not mean the element visible. It means the element is always visible. On every Page.

like image 43
penderi Avatar answered Jan 12 '23 13:01

penderi