Alpha or Transparent ?

I wanted to set a Picture Transparent, but I get an Exception error. *

To check that, I used the LR code that worked fine. Strange.

OK Xojo IDE, you do not want me to use Transparent ? I will use HasAlphaChannel (as advised by the LR).

No, I am not allowed to change that value.

isAlpha is a global set by a CheckBox.

[code]Dim Resized_Pict As New Picture(150, 150) // Picture with alpha channel

If isAlpha Then
Resized_Pict.HasAlphaChannel = True // Was: Resized_Pict.Transparent = 1 but got UnsupportedOperationException **
Else
Resized_Pict.HasAlphaChannel = False // Was: Resized_Pict.Transparent = 0 but got UnsupportedOperationException **
End If[/code]

Nota: I deleted many New Conversations before sending this one.

  • This is a workaround a bug with cropped images, resized by Xojo The same image, cropped or not will get a jagged look (if cropped) or not (if not cropped or if cropped, but at the correct size: not resized by Xojo).

** UnsupportedOperationException does not appears in the LR .

The LR example is… wrong in this line:

f = GetOpenFolderItem("image/jpeg") // I changed that to png…

and fortunately for this case / test, I was able to choose one of the jpg images I had in front of me in the dialog file selector :wink:

try

Dim Resized_Pict As New Picture(150, 150, 32)

Thanks Axel, but isn’t this… deprecated ?
(I forgot that one…)

Deprecated, maybe, but it seems to works (for now) !