Backdrop.Transparent Property

I have a project that I wrote a couple of years ago. I has a custom control with the ContainerControl as the super class. On that control is a canvas control that I assign one of about a dozen pictures depending on the return value of a function.

The place where the picture is selected is in the “Open” event. After I assign the icon to the canvas backdrop property, I set its background to transparent Like so:

Select Case OSCSVR.Server
Case “M32”
imgIcon.Backdrop = M32
imgIcon.Backdrop.Transparent = 1

It works great. Here’s the problem. I am working on a new program that uses the same control. I copied the control to the new project. It runs but the line that sets the backdrop to transparent throws an error. If I rem out that one line, it works but the canvas around the picture is white instead of gray like the rest of the window. I spent hours comparing properties between the one that works and the one that doesn’t but I cannot find any differences.

I am guessing that the transparent property was depreciated but I don’t write in xojo very often and I can’t find the information I need to fix it.

Any help would be greatly appreciated.

are both programs using the same version of Xojo ?
and if you right click and copy the error can you post it here ?

the containercontrol and your canvas have a transparent property,
if u drag a picture into project the transparent areas appear as square pattern.

the template control have transparent property and also the control in the window have a idividual settings.
inside your container control the canvas also have a transparent property.

BackDrop is a picture which no longer has a transparent property which is what his old code used to set

[quote=483672:@Norman Palardy]Markus
BackDrop is a picture which no longer has a transparent property which is what his old code used to set[/quote]
yes, the way i wrote works.

not if his picture doesnt have an alpha channel which is what the transparent property did

but i wrote how it should looks like.

png with alpha should be a common format today,

Here is the error message. Unfortunately, I don’t know what an Alpha Channel is or what to do about it.

'Exception Message: The Transparent property cannot be used with Pictures with alpha channels"

OK so your picture DOES have an alpha channel - thats good
thats a lot like a mask where the black areas are what will show and the white areas are ones that will be transparent
It can be shades of grey as well and then you get areas showing slightly translucent

try just commenting that line out and see if things appear properly

if not you may have to edit the image and its alpha channel to make certain areas transparent

this is about what the old transparent flag did but its been removed in the intervening years