cancel
Showing results for 
Search instead for 
Did you mean: 

Transparent Window in PB

Former Member
0 Kudos
480

We are working with PB 12.5

We would have a window transparent with a DataWindow that contains a Picture that is partially transparent.

We defined a Popup-Window that has BackColor transparent and contains only a DW that fills the whole window. This DW has also a transparent Background Color. It contains a png picture that is partially transparent.

Now  we would expect, that only the non-transparent part of the picture of the dw is shown when opening the window.

Unfortunately there is a lightgray rectangular background, when the window is opend.

Are we making somethin wrong or is it not possible what we want ?

Thanks for any tip

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Axel,

do you want to create a lighbox effect, how to see on the following example?

Best regards

Heiko

Former Member
0 Kudos

Hello Heiko,

we want to show a window like the one of my desktop (see left side of the app-window)

Therefore the main window must be completely transparent and the DW that fills the window also must be transparent as well as parts of the image that lies in the DW. I did so in my PB App but the background of the main window is light gray ...

Transfered to the example above it looks like (look at left side):

Best regards

axel

Former Member
0 Kudos

ok. This looks tricky to do with PowerBuilder.

For our ERP solution, we will create a lightbox effect to display product picture during the next weeks. If we will get perceptions, which are intersting for oyur problems, I will let you know it.

Best regards

Heiko

arnd_schmidt
Active Contributor
0 Kudos

Do you need this for PB.NET?

Former Member
0 Kudos

No, we need it for PB Classics Version 12.5.

It's possible ther to define a window with BackColor transparent and also to have a DW with transparent Background Color. I think this also must be possible with PB Classics.

Thanks

Former Member
0 Kudos

Did you also try setting the Transparency (%) property on the window to 100%?

Former Member
0 Kudos

I will try, but as I remember this will cause that the whole window will be transparent with all its content and by 100 % the window will not be visible at all.

Thanks.

Former Member
0 Kudos

You are correct.  The window will be completely invisible.

It appears I've misunderstood what you were trying to do.


arnd_schmidt
Active Contributor
0 Kudos

This feature seems to be broken ... you need some API Voodoo magic


Code for PB 12.5:

External Function Declaration:

Function long GetWindowLong (ulong hWnd, int nIndex) Library "user32.dll" Alias for "GetWindowLongW"

Function long SetWindowLong (ulong hWnd, int nIndex, long dwNewLong) Library "user32.dll" Alias for "SetWindowLongW"

Function Long SetLayeredWindowAttributes(ulong hWnd, Long crKey , byte bAlpha , Long dwFlags) Library "user32.dll"


Open () Event Script in Window:


Constant long  LWA_COLORKEY = 1

Constant long  GWL_EXSTYLE = -20

Constant long  WS_EX_LAYERED = Long(2^19)

SetWindowLong ( Handle(this), GWL_EXSTYLE, &

     GetWindowLong( Handle (this), GWL_EXSTYLE ) + WS_EX_LAYERED)

// Make "background" colored pixels transparent

SetLayeredWindowAttributes(Handle(this), This.BackColor , BYTE(0), LWA_COLORKEY)

hth

Arnd

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Axel

you can give this a try: http://download.catsoft.ch/files/pwait.zip.

You find details and fixes for unicode in https://groups.google.com/forum/#!topic/sybase.public.powerbuilder.general/B-PTXdZycgo

Regards

Arthur