Transparent window

Post Reply
Natter
Posts: 1241
Joined: Mon May 14, 2007 9:49 am

Transparent window

Post by Natter »

Hi,

Is it possible to make a transparent window with animated .gif ? The higher the transparency of the window (oDlg:nOpacity), the paler the gif image becomes :cry:
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: Transparent window

Post by Jimmy »

hi,

how does animated GIF work under FiveWin :?:

---

using DMW i can get "Glass Effect" when use {1,1,1} as Backgroud Color
so if Backgound of GIF is {1,1,1} you might get a "transparent" animated GIF

have a look here https://forums.fivetechsupport.com/viewtopic.php?f=3&t=42116
greeting,
Jimmy
Natter
Posts: 1241
Joined: Mon May 14, 2007 9:49 am

Re: Transparent window

Post by Natter »

Thanks Jimmy ! I looked at DWM but didn't understand how I can use it :(
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Transparent window

Post by nageswaragunupudi »

Natter wrote:Hi,

Is it possible to make a transparent window with animated .gif ? The higher the transparency of the window (oDlg:nOpacity), the paler the gif image becomes :cry:


Instead of nOpacity, please use nSeeThroClr.

This is a sample:

Code: Select all | Expand

#include "fivewin.ch"
#include "gif.ch"

function Main()

   local oWnd, oGif

   DEFINE WINDOW oWnd STYLE WS_POPUP

   @ 0,140 GIF oGif SIZE 240,260 FILE "..\gifs\forgif.gif" OF oWnd ;
      ADJUST ACTION oWnd:End()

   oWnd:nSeeThroClr  := CLR_WHITE

   ACTIVATE WINDOW oWnd CENTERED

return nil
 


Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
karinha
Posts: 7935
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: Transparent window

Post by karinha »

spectacular master nages.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Natter
Posts: 1241
Joined: Mon May 14, 2007 9:49 am

Re: Transparent window

Post by Natter »

Rao, excuse me, but I didn't understand how using the nSeeThroClr option would help to get a transparent window. I put together your example and got an animated Gif on a white window
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Transparent window

Post by nageswaragunupudi »

Did you build and run the same sample without any changes atleast once?
Regards

G. N. Rao.
Hyderabad, India
Natter
Posts: 1241
Joined: Mon May 14, 2007 9:49 am

Re: Transparent window

Post by Natter »

Everything works with the "Window", but "Dialog" cannot be made transparent
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Transparent window

Post by nageswaragunupudi »

Please try this:

Code: Select all | Expand

#include "fivewin.ch"
#include "gif.ch"

function Main()

   local oDlg, oGif

   DEFINE DIALOG oDlg SIZE 400, 300 PIXEL ;
      STYLE WS_POPUP COLOR CLR_BLACK,CLR_WHITE

   oDlg:nSeeThroClr := CLR_WHITE

   oDlg:bInit := <||
      @ 0,140 GIF oGif SIZE 240,260 FILE "..\gifs\forgif.gif" OF oDlg ;
         ADJUST ACTION oDlg:End()
      return nil
      >

   ACTIVATE DIALOG oDlg CENTERED ;

return nil
 


Please try another sample

Code: Select all | Expand

#include "fivewin.ch"
#include "gif.ch"

function Main()

   local oDlg, oGif

   DEFINE DIALOG oDlg SIZE 400, 300 PIXEL ;
      STYLE WS_POPUP COLOR CLR_BLACK,RGB(255,254,254)

   oDlg:nSeeThroClr := RGB(255,254,254)

   oDlg:bInit := <||
      @ 0,140 GIF oGif SIZE 240,260 FILE "..\gifs\halo.gif" OF oDlg ;
         ADJUST ACTION oDlg:End()
      return nil
      >

   ACTIVATE DIALOG oDlg CENTERED ;

return nil
 


Image
Regards

G. N. Rao.
Hyderabad, India
Natter
Posts: 1241
Joined: Mon May 14, 2007 9:49 am

Re: Transparent window

Post by Natter »

Everything is fine. Thank you very much.
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Transparent window

Post by nageswaragunupudi »

IMPORTANT:
Now, some explanation about the DATA nSeeThroClr.

When you assign any color value to oWnd/oDlg:nSeeThroClr, that color will be treated as transparent while the window/dialog is displayed.

When you choose a GIF, you should also know its background color. Also choose a gif, whoose background color is perfectly uniform.

While creating the dialog or window, set its colors to:
DEFINE oWnd/oDlg ...... COLOR <anyclr>, <background color of the gif)

Now, set the same background color to oDlg:nSeeThroClr
Regards

G. N. Rao.
Hyderabad, India
Natter
Posts: 1241
Joined: Mon May 14, 2007 9:49 am

Re: Transparent window

Post by Natter »

Yes, you are right, it was in the difference of the background color of the window color :nSeeThroClr that my mistake was :oops:
Post Reply