Transparent window

Transparent window

Postby Natter » Thu Sep 15, 2022 8:30 am

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:
Natter
 
Posts: 1199
Joined: Mon May 14, 2007 9:49 am

Re: Transparent window

Postby Jimmy » Thu Sep 15, 2022 11:18 am

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
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Transparent window

Postby Natter » Thu Sep 15, 2022 1:00 pm

Thanks Jimmy ! I looked at DWM but didn't understand how I can use it :(
Natter
 
Posts: 1199
Joined: Mon May 14, 2007 9:49 am

Re: Transparent window

Postby nageswaragunupudi » Thu Sep 15, 2022 6:18 pm

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 view
#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
nageswaragunupudi
 
Posts: 10604
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Transparent window

Postby karinha » Thu Sep 15, 2022 6:53 pm

spectacular master nages.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7780
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Transparent window

Postby Natter » Fri Sep 16, 2022 8:19 am

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
Natter
 
Posts: 1199
Joined: Mon May 14, 2007 9:49 am

Re: Transparent window

Postby nageswaragunupudi » Fri Sep 16, 2022 10:18 am

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10604
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Transparent window

Postby Natter » Fri Sep 16, 2022 11:09 am

Everything works with the "Window", but "Dialog" cannot be made transparent
Natter
 
Posts: 1199
Joined: Mon May 14, 2007 9:49 am

Re: Transparent window

Postby nageswaragunupudi » Fri Sep 16, 2022 11:42 am

Please try this:
Code: Select all  Expand view
#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 view
#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
User avatar
nageswaragunupudi
 
Posts: 10604
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Transparent window

Postby Natter » Fri Sep 16, 2022 12:26 pm

Everything is fine. Thank you very much.
Natter
 
Posts: 1199
Joined: Mon May 14, 2007 9:49 am

Re: Transparent window

Postby nageswaragunupudi » Fri Sep 16, 2022 12:34 pm

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
User avatar
nageswaragunupudi
 
Posts: 10604
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Transparent window

Postby Natter » Fri Sep 16, 2022 12:56 pm

Yes, you are right, it was in the difference of the background color of the window color :nSeeThroClr that my mistake was :oops:
Natter
 
Posts: 1199
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 46 guests