Alpha channel

Is there a way to create an Alpha or transparency channel in an object. Or another way to describe it. Is it possible to draw a picture frame in a form and display a transparent window in it to show objects ‘behind’ the frame??

Short Answer, NO. Long answer, XOJO its very limited on the GUI design, there is not working zOrder like in other languajes, So, its not possible to have overlaping controls in XOJO.

Maybe if you do it with 2 separate windows, for example on windows you can use SetWindowRgn API.

If I understand your question what you should do is create two canvas, the above is an image in PNG with transparent background and what is underneath appear within the frame.

Isnt a transparent background the implementation of an alpha channel?

try this code in the activate event window

[quote] const CocoaLib = “Cocoa.framework”
soft declare function NSClassFromString lib CocoaLib (aClassName as CFStringRef) as Ptr
soft declare function colorMaker lib CocoaLib selector “colorWithCalibratedWhite:alpha:” (NSColorClass As Ptr, white As Single, alpha As Single) As Ptr
soft declare sub setBGColor lib CocoaLib selector “setBackgroundColor:” (NSWindow As Ptr, backgroundColor As Ptr)
soft declare sub setOpaque lib CocoaLib selector “setOpaque:” (NSWindow As Ptr, flag As Byte)

dim w As Ptr = Ptr(Window1.Handle)

setOpaque(w, 0) //0 = off, 1 = on

setBGColor(w, colorMaker(NSClassFromString(“NSColor”), 10, 0))[/quote]

Thanks Paulo, with a few mods that snippet did the trick. I knew that there had to be a command or API to do this job.

I Glad to have helped .

Good Projects!