Windows 10 - Window background transparent?

  1. 3 weeks ago

    Derek D

    Feb 5 Pre-Release Testers Newnan, GA. USA

    Hey all,
    I have an interesting issue that i've researched a bit, but not sure how to go about doing it.

    I have an image saved as a 32-bit .PNG with a transparent background, but in Xojo it shows with a white background no matter what settings I use. See pic:
    -image-

    What's the best and easier way to get this to display without the white background on Windows 10? Maybe a solution for both Mac and Windows?
    Thanks!

  2. Jonathan E

    Feb 5 Pre-Release Testers, Xojo Pro Las Vegas, NV

    Have you given this a try?

    https://forum.xojo.com/5071-how-to-create-a-transparent-window/p1#p35688

  3. Derek D

    Feb 5 Pre-Release Testers Newnan, GA. USA

    @Jonathan E Have you given this a try?

    https://forum.xojo.com/5071-how-to-create-a-transparent-window/p1#p35688

    I saw this. How would I call this?

  4. Jonathan E

    Feb 5 Pre-Release Testers, Xojo Pro Las Vegas, NV
    1. Copy the whole method into your project.
    2. Set the parameters as those specified in the header.
    3. Then call that method before showing that window passing the window as an object and a value for the alpha channel.
  5. Julian S

    Feb 6 Pre-Release Testers, Xojo Pro UK
    Edited 3 weeks ago

    How is that overlayed? A control over another control or is it all being painted via a single canvas?

    Edit: Can you also link the image?

  6. Derek D

    Feb 6 Pre-Release Testers Newnan, GA. USA
    Edited 3 weeks ago

    @Julian S How is that overlayed? A control over another control or is it all being painted via a single canvas?

    Edit: Can you also link the image?

    It's a window with a backdrop and 6 canvases being used for the 'buttons'. The graphic backdrop has a .PNG transparent alpha channel, so it should be transparent, I think.

  7. Derek D

    Feb 6 Pre-Release Testers Newnan, GA. USA

    @Jonathan E 1. Copy the whole method into your project.

    1. Set the parameters as those specified in the header.
    2. Then call that method before showing that window passing the window as an object and a value for the alpha channel.

    It works, but for the whole window, not just the white background part. Sorta cool though.

  8. 2 weeks ago

    Sascha S

    Feb 6 Pre-Release Testers, Xojo Pro Germany

    @DerekDiBenedetto It works, but for the whole window, not just the white background part. Sorta cool though.

    You should change the title of this Thread ;)

  9. Julian S

    Feb 6 Pre-Release Testers, Xojo Pro UK

    @DerekDiBenedetto It's a window with a backdrop and 6 canvases being used for the 'buttons'. The graphic backdrop has a .PNG transparent alpha channel, so it should be transparent, I think.

    Ah. Is there no way to refactor the code to have the image drawn on the canvas of the main screen rather then using another window?

    If you want to key out a window in windows, take a look in the examples folder under Platform-specific>Windwos>CustomWindowShape

    Here's an example I put together a while back for someone to show animation on a key'd window that uses a slightly different method:

    https://www.dropbox.com/s/at4ktyd0cxkn126/TestCircleRotationOnTransparentBackground.xojo_binary_project?dl=1

    Hope it helps.

or Sign Up to reply!