# canvas transparency - again

**URL:** <https://forum.xojo.com/t/canvas-transparency-again/50527>\
**Category:** Getting Started\
**Created:** [October 8, 2019, 8:07pm UTC](https://forum.xojo.com/t/canvas-transparency-again/50527 "2019-10-08T20:07:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco\_Weinrich](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@Marco\_Weinrich](https://forum.xojo.com/u/Marco_Weinrich)\
**Post date:** [October 8, 2019, 8:07pm UTC](https://forum.xojo.com/t/canvas-transparency-again/50527/1 "2019-10-08T20:07:58Z")

</div>

Hello,  
if I put on a transparent png as backdrop to a canvas, why (and this is what I want) can I see the controls through when running on my Mac and when compiled for Windows it does not, the png is opaque to controls, not to the background? Red is the window background color, everything blue the png

![](https://i.ibb.co/CQb70gf/screen.png)

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [October 8, 2019, 8:24pm UTC](https://forum.xojo.com/t/canvas-transparency-again/50527/2 "2019-10-08T20:24:14Z")

</div>

Because it uses Direct2D, Windows uses pseudo transparency, which means instead of being transparent, a canvas takes the color of it’s parent.

My solution was to stay with 2016R2.1 where the Windows version works like the Mac version, with truly transparent canvas.

---

<div class="post-metadata">

**Author:** ![Marco\_Weinrich](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@Marco\_Weinrich](https://forum.xojo.com/u/Marco_Weinrich)\
**Post date:** [October 8, 2019, 8:38pm UTC](https://forum.xojo.com/t/canvas-transparency-again/50527/3 "2019-10-08T20:38:26Z")

</div>

Thanks Michel, i tested it with 2017R3 and there it works on windows, too.  
So, is the pseudo transparency related to Xojo in newer Versions? I guess I cannot use the “old” way in 2019.R1 like it was in 2016/2017, right?

And, why does it display correct transparent in the GUI (on Xojo for Windows) and not in the compiled app?

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [October 8, 2019, 10:54pm UTC](https://forum.xojo.com/t/canvas-transparency-again/50527/4 "2019-10-08T22:54:26Z")

</div>

Yes. I don’t remember exactly when Direct2D was implemented, but indeed you cannot _easily_ get the same transparency with 2018R1 through 2019R1.1.

The only way to get an effect of transparency with latest Xojo Windows canvas, would be to take a screen shot of what is behind the canvas, and draw it on it.

It should be possible, though, to bring back the truly transparent canvas in a plugin. It would just be necessary to create a custom control around a good old Win32 canvas !

The reason why the canvas displays as transparent in the IDE is probably because the IDE does not show you the true control. Or that it still uses the Win32 control 😉

---

<div class="post-metadata">

**Author:** ![Marco\_Weinrich](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@Marco\_Weinrich](https://forum.xojo.com/u/Marco_Weinrich)\
**Post date:** [October 9, 2019, 6:34am UTC](https://forum.xojo.com/t/canvas-transparency-again/50527/5 "2019-10-09T06:34:42Z")

</div>

first i was so happy that flickering on a scrolling canvas was much reduced on windows in 2019r1, but that is the downside. I now have the choice between truly transparent canvas in R2016 (with flickering) or less flickering without true transparency in R2019…

But, thanks again Michel for clearing that up.

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [October 9, 2019, 10:33am UTC](https://forum.xojo.com/t/canvas-transparency-again/50527/6 "2019-10-09T10:33:55Z")

</div>

There could be a way to obtain transparency in some cases, mind you not the example you posted.

The example at below allows creating a window where everything in a mask picture that is white becomes transparent (shape.bmp).  
The very same technique of setting regions that become transparent can be used to create a canvas with pretty much any shape.  
Since under Windows the same declares can be used on Windows as well as controls (they are technically considered child windows), this example can be applied quite easily.

/Applications/Xojo 2017 Release 2.1/Example Projects/Platform-Specific/Windows/CustomWindowShape

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [April 29, 2021, 4:07pm UTC](https://forum.xojo.com/t/canvas-transparency-again/50527/7 "2021-04-29T16:07:01Z")

</div>


